Rs.getstring vs rs.getdouble

zhaozj2021-02-16  94

I wrote this sentence in a few days ago I wrote this sentence: form.valueof ((Rs. Valueof)))); Form is an Actionform object, A is an attribute of a string type, At the same time, the REAL type field name name is A

A colleague asked me why I didn't use form.seta (RS.GetString ("A")); I also thought, yeah, why not write, simple

Later, I found that there is a problem. For example, "0.1" is "0.1", which has become "0.099999134384034" and a homewhat wonderful digital debugging found that the Sybase is indeed not "0.1", and It is the data such as "0.0999999134384034" S.

For the field of the database INTEGER type, since String.Valueof (RS.Getint ()) and RS.Getint () is equivalent to depositing data and database actually saving data.

Conclusion: It is recommended to use RS.GETDOUBLE (RS.GetFloat) to get the correct value by RS.GETDOUBLE (RS.Getfloat), and it should not be used directly to use gtstring.

转载请注明原文地址:https://www.9cbs.com/read-12199.html

New Post(0)