Instructions
-
- 1
Go to a MySQL prompt so that commands can be entered by typing the following:
mysql>
From here, varchar values can be converted into floating point numbers.
- 2
Type in a select statement, formatting the varchar as a floating point number by placing "0.0" after the varchar string to be converted. For example:
sql> Select '1.5'+0.0;
This is displayed as 1.5 in MySQL as expected.
-
- Datasheet Search Engine
New Electronics Datasheet Site 65 Million Parts, Free PDF Download
www.datasheets360.com
- Datasheet Search Engine
- 3
Enter a large floating point number as a float, and consider how the floating point number is rounded off, as in the following example:
mysql> SELECT '18215376320333968'+0.0;
The result of this is the number below (due to rounding):
1.8215376320334e+16
- 4
Include letters in the floating point number to be converted as follows:
Select 'abcdef1234'+5.5 ;
This results in an output of "5.5" as the letters are ignored.
- 1
Read more: http://www.ehow.com/how_8539227_convert-varchar-float-mysql.html#ixzz328azNy00