lion79
asked on
convert value....very simple question
HI,
my question is pretty simple,i have a form that the user insert value in cu/m3 and i want it to be saved in the database as MGD which is equal to :(cu/m3)/4747
i tried this
textbox1=textbox1/4747 but gave me an error,whats the best way for the conversion???
my question is pretty simple,i have a form that the user insert value in cu/m3 and i want it to be saved in the database as MGD which is equal to :(cu/m3)/4747
i tried this
textbox1=textbox1/4747 but gave me an error,whats the best way for the conversion???
textbox1.text = (convert.todecimal(textbox 1.text) / 4747).tostring
ASKER
i want to thank you emoreau for your answer but i need one more thing,the value comes in long decimal,i just want to save the 3 digits(0.264),how can i define that?
textbox1.text = formatnumber((textbox1.tex t / 4747) , 3)
or .. using emoreau comment
textbox1.text = formatnumber((convert.tode cimal(text box1.text) / 4747), 3).tostring
or .. using emoreau comment
textbox1.text = formatnumber((convert.tode
>>just want to save the 3 digits
if what u save is what u r concerned with and if u r using SQL server, u could just define the datatype to accept 3 decimals .. am not sure whether it is possible in MSAccess .. but am almost sure, there has to be an option for that ...
if what u save is what u r concerned with and if u r using SQL server, u could just define the datatype to accept 3 decimals .. am not sure whether it is possible in MSAccess .. but am almost sure, there has to be an option for that ...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks alot for your help emoreau and you too Rej........