Formatting numbers in Velocity Templates?

I need to display amount in following formats:

1099 -> 1,099.00

100 -> 100.00

100.251 -> 100.25

10999 -> 10,999.00

1110999 -> 11,10,999.00

Right now I am using following code to display amount:

$numberTool.format("#0.00", $credit);

In this case, if amount is 1099, then it displays 1099.00 but I want to display this amount in this format:- 1,099.00

View Answers









Related Tutorials/Questions & Answers:
Advertisements