I have entered a value to my database as $1000000000. it stored in Database also its looks like as same. when retrieve it from using the DB. Its converted to $1e+09 automatically. how to restrict it.
thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1.000.000.000 is equal to 1e+09, the only difference is that the second is value is printed in scientific notation. You said, that the database field holds the value in it’s “standard” form.
I assume, you get the value and store it in a float (Float) or double (Double) field/variable. Now if you convert that number to a String you can use the
Formatterclass to choose between scientific and non-scientific representation:Hint – if you have a currency output and want to restrict the precision, try