aspose file tools*
The moose likes JSP and the fly likes number format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "number format" Watch "number format" New topic
Author

number format

liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
I'd like to format a number in terms of dollars and cents inside my jsp code, so without using jstl libraries. Can someone please tell me how I can do this, maybe post an example?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61222
    
  66

Originally posted by liliya woland:
without using jstl libraries.


Why not?

Can someone please tell me how I can do this, maybe post an example?


Explore java.text.NumberFormat


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rusty Smythe
Ranch Hand

Joined: Aug 09, 2006
Posts: 93
Here is a standalone app I whipped out for you:



Just steal the guts and have fun.
liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
because I'm concatinating my numbers into a String in one case and adding them up as an Integer into a sum in another case before they the numbers go into a web page. At this point I'm using
NumberFormat numformat = NumberFormat.getInstance();
It works fine when I do numformat.format(somenum)
liliya woland
Ranch Hand

Joined: Apr 11, 2006
Posts: 134
Thanks a lot Rusty!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: number format