Formatting numbers in Velocity Templates?

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:
Formatting numbers in Velocity Templates?
Formatting numbers in Velocity Templates?
formatting program
formatting tag in HTML
text formatting tag in HTML
Version of velocity>velocity dependency
Formatting text in HTML
< problem in XSL formatting
Version of velocity>velocity-dep dependency
ModuleNotFoundError: No module named 'flake8-printf-formatting'
ModuleNotFoundError: No module named 'gspread-formatting'
automorphic numbers
sorting numbers
Prime Numbers
XML and Velocity
Artifacts of velocity
Version of velocity-tools>velocity-tools dependency
Version of plexus-velocity>plexus-velocity dependency
Version of velocity-dvsl>velocity-dvsl dependency
Numbers pyramid
Rational Numbers
Listing all even numbers between two numbers
how to add to numbers in java
ModuleNotFoundError: No module named 'bottle-api-json-formatting'
Formatting Legend in Chart in Flex4
Version of velocity-tools>velocity-tools-view dependency
Version of velocity-tools>velocity-tools-generic dependency
Hexadecimal numbers multiplication
Addition of two numbers
defining numbers in Java Script
Maven Repository/Dependency: velocity | velocity
ModuleNotFoundError: No module named 'numbers'
multiply of 100 digits numbers
numbers divisible by 5 and 6
ModuleNotFoundError: No module named 'velocity'
Version of maven>velocity dependency
Adding two numbers
prime numbers - Java Beginners
Scanning and Formatting in Java
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
Generate Random Numbers
random numbers - Java Beginners
odd numbers with loop
Maven Repository/Dependency: velocity | velocity-dep