mob/var/hp = 0 as num
mob/Stat()
..()
statpanel("sdafd")
stat("HP:","[num2text(src.hp,99999999)]")
mob/verb/AddHP(N as num)
hp += N
mob/verb/Thingy()
src << src.hp
But the thing is I add this to the hp(99999999), and this is what I see in the statpanel.. 100000000
Why when I add 0 to 99999999 I get 100000000. Would that make the BYOND system inaccurate with adding? Please give me the 411
ID:148936
Aug 10 2002, 3:51 pm
|
|
I don't want it to display scientific notation. That's what num2text does. Do this and tell me what you get
mob/verb/Thing() var/result = 0 var/thing = 99999999 result += thing src << result You will get 100000000. That's a problem. | |
#3 Aug 10 2002, 4:46 pm
|
|
It's not about adding. I believe it's about storage. A computer has a finite amount of bits to store things in. At a certain point, small differences are pretty much ignored. (It's not exactly a BYOND thing.)
world << "[99999999]" will output 1e+008 whether or not you add anything. So will 99999998. Those numbers are huge. | |
Super16 wrote:
I don't want it to display scientific notation. That's what num2text does. Do this and tell me what you get You can make your own proc for this; it will be limited to the accuracy of floating point, but it should suffice for this. With your own proc, you can also put in commas:
Lummox JR | ||
Lummox JR wrote:
Super16 wrote: You do know you will get an error. For dec being an undefined var. You defined for only under the if statement.. Just wanted to tell you that... | ||
Change
to
> stat("HP:",src.hp)