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

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -