Subject: Numeric Display in Text Box
Posted By: Tallon Wolle Post Date: 12/4/2003 10:58:25 PM
Dear All,

I write in VB6. I have a problem of figure display in Textbox. When I enter figure in textbox say 2183889222.34 and another figure in another textbox say 4783845689.45 to be added together so that the result is displayed in another textbox. The result is displayed in an exponential format.  What could be the problem.


Thanks,

Tallon Wolle

Reply By: owain Reply Date: 12/5/2003 4:11:59 AM
Use the VB function CDec().
Text3.Text = CDec(Val(Text1.Text) + Val(Text2.Text))
This will force the result of the addition to be displayed in decimal format. The down side it that it will use more memory and you will run into overflow errors when the numbers get very large. This is because the decimal data type stores the number with a much higher precision than a single or double, the trade off is that it can not store the much larger numbers.

Regards
Owain Williams

Go to topic 6360

Return to index page 992
Return to index page 991
Return to index page 990
Return to index page 989
Return to index page 988
Return to index page 987
Return to index page 986
Return to index page 985
Return to index page 984
Return to index page 983