0

I have to format given character [132233.2453] like this -> 132,233.2453

current code -> $number.format("###,###.##00", $value)

which seems to be working fine, but for character [295] -> it should be 295.00 [minimum 2 characters after decimal points] but it is coming 295 [without any decimal points]

lfurini
  • 3,729
  • 4
  • 30
  • 48

1 Answers1

0

In Velocity, double quoted strings are interpolated. And in an interpolated string, ## starts a line comment. So basically your formats are empty.

Also, the decimal specification should be 00## and not ##00.

So try: $number.format('###,###.00##', $value)

Claude Brisson
  • 4,085
  • 1
  • 22
  • 30