I have a BigDecimal
field amount
which represents money, and I need to print its value in the browser in a format like $123.00
, $15.50
, $0.33
.
How can I do that?
(The only simple solution which I see myself is getting floatValue
from BigDecimal
and then using NumberFormat
to make two-digit precision for the fraction part).
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…