user12295267
user12295267

Reputation:

Keeping trailing zeroes in Javascript

How do you add additional zero(s) at the end of a number?

For example, if the user choose "0" in the Precision column the Lower Limit value will show like this: Precision: 0, Lower Limit: 90%

If "1":

Precision: 1, Lower Limit: 90.0%

If "2":

Precision: 2, Lower Limit: 90.00%

Upvotes: 0

Views: 53

Answers (1)

soma
soma

Reputation: 101

You can specify the number of decimals to be rendered by using the .toFixed() method.

Number.pototype.toFixed()

Upvotes: 1

Related Questions