| View previous topic :: View next topic |
| Author |
Message |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Fri May 02, 2008 5:52 am Post subject: high/low numbers on VB6 |
|
|
it writes 1,23434E+12 or sth ..
i know it means * 10 ^ 12
but i dont want him to write like that
how can i fix it?
_________________
|
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Fri May 02, 2008 6:46 am Post subject: |
|
|
| mas8rx8 wrote: | you dont want HIM to write like that?
So you want to fix what?
1,23434E+12? |
i want him to write
1234340000000 instead of 1,23434E+12 !
_________________
|
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Fri May 02, 2008 7:46 am Post subject: |
|
|
| mas8rx8 wrote: | I don't think you can do that.
As E+12 means 12 0-s.
You can however set it to remove E+?? and add ?? zeros? |
no.. he will replace it with E+?? again
edit:
i got it
i tell him
round (text1.text = x)
and he writes x numbers behind the ,
thanks for trying
_________________
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Fri May 02, 2008 9:03 am Post subject: |
|
|
(Kind of side note, but might help you Googling.) No idea about VB, but in C++ std::fixed should do the job. Eg with console output: | Code: | | std::cout << std::fixed << number; // number is a double. |
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Fri May 02, 2008 9:10 am Post subject: |
|
|
the problem is the kind of variable you are storing it in, storing the value as a long, or double, or another kind may get rid of the problem
_________________
|
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Fri May 02, 2008 9:35 am Post subject: |
|
|
i told you i fixed it by round command
i tried integer but that cause problems with high numbers
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri May 02, 2008 10:03 am Post subject: |
|
|
| 92Garfield wrote: | i told you i fixed it by round command
i tried integer but that cause problems with high numbers |
Thats because an integer in VB6 does not hold high number values. An integer in VB only holds between -32768 to 32767. If you didn't know this already you should really go back and learn the basics of the language as it seems you don't know the variable types well.
_________________
- Retired. |
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Fri May 02, 2008 10:06 am Post subject: |
|
|
| Wiccaan wrote: | | 92Garfield wrote: | i told you i fixed it by round command
i tried integer but that cause problems with high numbers |
Thats because an integer in VB6 does not hold high number values. An integer in VB only holds between -32768 to 32767. If you didn't know this already you should really go back and learn the basics of the language as it seems you don't know the variable types well. |
yeah thats why im making much crap programms i hope i encounter problems
i know, i know less
i usually dont use variables in VB
i avoid that by using "invisible" labels
but i know no one that could help me on VB else CEF members
wher can i see what which type of variable can hold?
_________________
Last edited by 92Garfield on Fri May 02, 2008 10:10 am; edited 1 time in total |
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri May 02, 2008 10:09 am Post subject: |
|
|
Using labels to store information to be used as variables is very very poor programming as well as a lose of efficiency and speed in your program. While you might not notice the impact on the small things you are currently making, it will have a huge impact on anything you make that is a very large scale application.
| Quote: | | but i know no one that could help me on VB else CEF members |
Saying that no one here will help you is hardly an excuse for poor programming. You have access to the internet. Use it.
www.vbforums.com is a nice community for VB6/.NET
_________________
- Retired. |
|
| Back to top |
|
 |
92Garfield I'm a spammer
Reputation: 57
Joined: 20 Dec 2007 Posts: 5871 Location: Banana Republic Germany
|
Posted: Fri May 02, 2008 10:11 am Post subject: |
|
|
i said i havent known anything else that could help me in VB
edit cant register at VBforums
_________________
|
|
| Back to top |
|
 |
|