# I need to truncate the decimal places not round up the number; how do I do this?

1539 0 3I've created a survey and a variable to report out the survey results.I need the decimal places as I report out on the measure. How do I truncate to 2 decimal places?

Thanks in advance

## Answers ( 3 )

I've used VariableName.toFixed(x)

However many number you want to have AFTER the decimal is the number you put in (x).

Here's a link: W3Schools Reference to Javascript .toFixed(x)

#### Comments

( 3 )Brent, use a name on your link so it looks better on a mobile. Links don’t wrap on community.

Thanks, Brent! This is exactly what I needed. Btw - it also rounds on the hundredth place, which is even better :)

Have you looked at using JavaScript? here's a link to the JS function it sounds like you would want.

## Comments

( 0 )