Formatting numbers in Velocity Templates?

Ads
 

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

Ads









Related Tutorials/Questions & Answers:
Formatting numbers in Velocity Templates?
Formatting numbers in Velocity Templates?
Advertisements
formatting program
Version of velocity>velocity dependency
formatting tag in HTML
text formatting tag in HTML
Formatting text in HTML
Version of velocity>velocity-dep dependency
< problem in XSL formatting
Velocity
XML and Velocity
Artifacts of velocity
Version of plexus-velocity>plexus-velocity dependency
Version of velocity-dvsl>velocity-dvsl dependency
Version of velocity-tools>velocity-tools dependency
Version of velocity-tools>velocity-tools-view dependency
Version of velocity-tools>velocity-tools-generic dependency
automorphic numbers
sorting numbers
numbers
Prime Numbers
Numbers pyramid
Rational Numbers
Formatting Legend in Chart in Flex4
Version of maven>velocity dependency
Maven Dependency velocity >> 1.3.1
Maven Dependency velocity >> 1.3
Maven Dependency velocity >> 1.4
Maven Dependency velocity >> 1.4-rc1
Maven Dependency velocity >> 1.5
Listing all even numbers between two numbers

Ads