Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 4th, 2003, 11:58 PM
Registered User
 
Join Date: Nov 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Numeric Display in Text Box

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

 
Old December 5th, 2003, 05:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use the VB function CDec().
Code:
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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Count in combo box(display results in text box) mboyisis Access 4 April 4th, 2008 07:08 AM
Get last record and display in an Text Box hewstone999 Access VBA 1 March 18th, 2008 06:48 AM
Display of 2 dimensional array numeric data oldrocketdog Visual Basic 2005 Basics 0 December 6th, 2005 10:39 AM
Search using drop down list box and a text box tcasp Classic ASP Basics 1 July 31st, 2003 02:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.