Cutting off decimal points


#1

I want to avoid showing decimal points in some of the variables in the stat screen.

Basically, I now have a variable called “hit points”, but if I do fairmath on it I end up with 13.4666666666 hit points, which doesn’t look very nice. Is there any way to avoid showing so many decimal points? Or better to just display it as a health bar?

Mmmmmmmmm


#2

That’s weird. Fairmath will always produce rounded up/down value.
Well, the manual code is *set varname round(varnamehere), if you want to go that way.


#3

Wait, I though fairmath automatically rounded… :confused: But do you really want to use fairmath for hitpoints? You’d never get down to 0… (I mean, not that that’s a problem, I always think dying in a CoG due to losing hitpoints is a pretty terrible ending, but still…)


#4

*round(number) will round it to the nearest integer.

If you want a health bar, you could set an initial health of 100 and subtract from that, and display it like any other stat bar.

Edit: Missed the fairmath thing but agree with it. (Good morning all)


#5

Following on from catorrina, if you just want to change how they’re displayed:

*set displayhp round(hitpoints)

You have ${displayhp} health left.

#6

Morning :raised_hand_with_fingers_splayed:t4:
Although, it’s night at here, but just as my professor said, “Everytime is glorious morning. Morning glory.”


#7

Couldn’t comment on how fairmath is supposed to behave, but this will strip the decimals off without rounding:

*temp remainder 0
*set remainder (number modulo 1)
*set number (number-remainder)