rounding and formatting decimals (forced) | XM Community
Solved

rounding and formatting decimals (forced)

  • 29 September 2018
  • 2 replies
  • 132 views

I have some embedded data random decimal values that I am using to form my questions. I have them rounded like this:

$$e{ round( e://Field/Savings , 2 ) }

this works great when the values are not divisible by .1, which then will show along the lines of $4.2

Is there any way to format to show 2 decimals, even when the 100's spot is a zero? (would like it to show $4.20)
icon

Best answer by PeeyushBansal 29 September 2018, 06:55

View original

2 replies

Userlevel 7
Badge +33
You can calculate using JavaScript and store it as embedded

https://stackoverflow.com/questions/6134039/format-number-to-always-show-2-decimal-places
ahhh, so not just using the normal block question setup. Now why couldn't this be an undocumented feature like mod (%) in the math section... 😀

Leave a Reply