String format in java? -


Input String: 115.0000

Output must be like string: 115.00

I used this code:

  string. Format ("% .2f", "115.0000");  

I found illegal subdivision exceptions . what can I do now?

You are submitting a string, but it is a floating point value. Remove the quotes around the number (the second parameter).


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -