Take the 2-minute tour ×   float rt = float.Parse("12.50%");  I
am getting the error message as  System.FormatException: Input
string was not in a correct format.  How to parse a value to
float?  share|improve this question remove the "%" symbol from
the string before parsing –  Heisenbug May 9 at 8:16 Remove % as
float.Parse("12.50") –  user2031802 May 9 at 8:17 You forget
c#-5.0 tag –  Soner Gönül May 9 at 8:17 add comment  3 Answers
It's the % which is causing a problem here. Either use
DecimalFormat with a custom pattern, or strip the % before you
parse.  You should also be aware of cultural context - will the
input always use . as the decimal separator, or do you need to
use the locale of the supplier of the value? For example, in
some locales this would be represented as "12,50%".
share|improve this answer add comment float rt =
float.Parse("12.50%".Replace("%","")); share|improve this answer
add comment  It is due to '%' sign in 12.50%  pasring is done in
the same way you did it or,  float.TryParse a