Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing float value

Status
Not open for further replies.

baran121

Programmer
Sep 8, 2005
337
TR
hi. i want to change values of a table column.

exampe:
2300
1800
1200
1
54200
2354.46
121.12

in my table.

i want to do like that:
2.3
1.8
1.2
0.001
54.20
2.35446
0.12112

how can i do that with code.
please help me.

 
how cant i see that i didnt understand :)
thank you very much
 
Code:
update TestTable set Amount=Amount/1000
 
incidentally you should not store your numbrs as float. This division willnot give correct results in float as float is not an exact data type. All numbers you plan to do math on should be stored as numeric or decimal datatypes.

"NOTHING is more important in a database than integrity." ESquared
 
All numbers you plan to do math on should be stored as numeric or decimal datatypes."

i disagree with this

what about scientific numbers? don't they fall within "all" numbers?

FLOAT has its place, although you are right, we should never use FLOAT for stuff like prices


r937.com | rudy.ca
 
OK rudy you are right, I've never needed scientific notation, so I didn't think about that.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top