Forum Discussion

BowBharath's avatar
7 years ago

Formate function rounding the decimal ?

<#assign x = 9999 / 1000>
${x}
${x?string["#.##"]}   

 

The above gave me  10 as result.  This is suppose to be 9.99 .

 

Help me to get achive the expected one. I tried all the 0 and # format.

  • Searched lot of option on format function and  did this to work. 

     

      ${9998?string["0.#;; roundingMode=down"]}

  • Searched lot of option on format function and  did this to work. 

     

      ${9998?string["0.#;; roundingMode=down"]}