Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in Currency formatting  RSS feed

 
ChakraPani Margani
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai to all,
I have a doubt in the currency formatting.


if the input is : "70529.44" then the
output should be: "$70,529.44"

can anybody send me the code for this...
This is very urgent for me.......
please send me code ASAP


thanking you....
 
Kuba Zygmunt
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should use:
NumberFormat - to format your currency.
BigDecimal - to store the value;



The output is:

$70,529.44
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!