Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

convert value....very simple question

Posted on 2005-05-15
6
Medium Priority
?
180 Views
Last Modified: 2010-04-07
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???
0
Comment
Question by:lion79
  • 2
  • 2
  • 2
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 14005776
textbox1.text = (convert.todecimal(textbox1.text) / 4747).tostring
0
 

Author Comment

by:lion79
ID: 14008501
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?
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 14008653
textbox1.text = formatnumber((textbox1.text / 4747) , 3)
or .. using emoreau comment
textbox1.text = formatnumber((convert.todecimal(textbox1.text) / 4747),  3).tostring
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 26

Expert Comment

by:Rejojohny
ID: 14008665
>>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 ...
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 14008913
textbox1.text = (convert.todecimal(textbox1.text) / 4747).tostring("#,##0.000")
0
 

Author Comment

by:lion79
ID: 14015917
thanks alot for your help emoreau and you too Rej........
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question