Re: Avoid Overflow!
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Mon, 10 Oct 2005 21:58:53 -0400
"Arpan" <arpan_de@xxxxxxxxxxx> wrote in message
news:1128993350.589501.267970@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I have another query pertaining to this - my VB application lets users
> do a lot of calculations. Often the end result may turn out to be a
> very big number. Under such circumstances, it happens that the number
> is displayed to the user in the exponential form. For e.g.
> 282748441902441558837890625 will be displayed as 2.82748441902442E+26.
> How do I make VB display the number as it is & not in the exponential
> form?
This really isn't related to the subject of your original post and therefore
should have been a new post with a new subject.
Look up the Format function (and be sure to click on the See Also link for
additional topics). You can use it to format the display of pretty much
anything you want in any way you want. In the case of very large or small
numbers, VB defaults to displaying it using scientific notation. If that's
not what you want, you need to write code to format the number otherwise.
This kind of goes along with what I said before about not letting VB coerce
data types. VB will also display things in certain ways that may not be
desirable. You have to control that yourself, just like you have to (or
should) control converting from one data type to another. VB does these
things for you to make the language easier to use. But that doesn't mean
it's better, and usually it doesn't give you exactly what you want. To get
what you want, you have to write the code to do it.
--
Mike
Microsoft MVP Visual Basic
.
- References:
- Avoid Overflow!
- From: Arpan
- Re: Avoid Overflow!
- From: Someone
- Re: Avoid Overflow!
- From: Arpan
- Avoid Overflow!
- Prev by Date: Re: Avoid Overflow!
- Next by Date: Re: Converting decimal to BCD (binary coded decimal)...
- Previous by thread: Re: Avoid Overflow!
- Next by thread: Re: Avoid Overflow!
- Index(es):
Relevant Pages
|