Posts ID:154948
 ID:154948   Oct 29 2011, 11:31 pm Whenever I write a long number I get something like this 7.03398e+008 . Yea sure it's a condensed version, I get that but what if I wanted to actually just write a long number? Thank you. This has been bugging me for so long now.
 #1 Oct 29 2011, 11:34 pm use the num2text proc
 #2 Oct 30 2011, 2:25 am The funny part being, the number they give you is quite a bit bigger than the actual one.
 #3 Oct 30 2011, 5:31 am As ZOMGbies said, use the num2text proc, however I would first recommend trying the search function on the forum, as this question has arrived and been solved many times before.
 #4 Nov 1 2011, 10:04 pm In response to El Wookie (#3) Okay, thanks.
 #5 Nov 2 2011, 2:43 pm In response to Moonlight Memento (#2) What do you mean? It's not changing any numbers.
 #6 Nov 2 2011, 4:55 pm In response to Warlord Fred (#5) When numbers are in the millions, byond outputs them as though a calculator would when youve made a number too wide for the screen. To combat this you transform the numbers into text and byond treats them like a sentence
 #7 Nov 3 2011, 8:25 am In response to Saucepan Man (#6) It's scientific notation. e means 10, and e+008 would be 10^8, or 100000000. 7.03398e+008 is 703398000.
 #8 Nov 3 2011, 5:51 pm In response to Warlord Fred (#7) It's also a bigger number in text. 1,250,000 is smaller than 1,250,0e+007. Why does BYOND default to the e+thousands of numbers, anyway? I can't think of a single person who'd actually want that for any form of project.
 #9 Nov 4 2011, 4:03 am In response to Moonlight Memento (#8) Because, 1,250,000,000,000,000,000,000,000,000,000,000 is not shorter than 1,250,0e+034
 #10 Nov 5 2011, 1:28 am In response to Moonlight Memento (#8) By default, if the number of significant figures exceeds 6, the number will be in scientific notation. If you don't like that, use num2text(1250000,9) so that it won't output a scientific notation unless the number of significant figures exceeds 9.
 #11 Nov 5 2011, 2:31 am In response to El Wookie (#9) El Wookie wrote: Because, 1,250,000,000,000,000,000,000,000,000,000,000 is not shorter than 1,250,0e+034 That's actually a number, though. I doubt aside from people who took programming classes (which is where I assume you'd see this) would know 1,781,0e+08 actually means something.
 #12 Nov 5 2011, 2:34 am In response to Jemai1 (#10) I don't get why it does it at all. No other thing does this, and it's not like it'd really be helpful for anything that I can think of. Only reason I can think of as to why they can't just default it to an actual number, is that it might break old games.
 #13 Nov 5 2011, 8:52 am In response to Moonlight Memento (#11) It's probably got something to do with the amount of bytes you can contain within an int that BYOND handles. Hence it uses an algebraic formula to reduce the byte size. I have no clue if this is correct, but it seems logical.
 #14 Nov 5 2011, 9:58 am In response to Moonlight Memento (#12) It's for memory purposes. Once a variable reaches a certain point of taking up too many bytes, BYOND condenses it so that it doesn't use up as much memory. You could easily work around this problem with a datum and datum mathematical functions.