# How to save the hit points in integer

Status
Not open for further replies.

#### Ultimatus

Level 4
i wanted to know if it is possible to save hit points of units in integer but without the 100.XXX (without the XXX in WE its called real) so only for exaple 200 HP and not 200.000 ...

#### Los_Tacos

Level 7
Hit points are real numbers. You can convert reals to integers but I'm not sure on how it cuts off the decimals; it probably just rounds it.

Convertion - Integer to Real

#### Eleandor

Level 21
I2R rounds down, always. You could create your own function for rounding up though, it's not that hard...

#### Ultimatus

Level 4
yay im so stupid its a basic funktion nah it was just to late so my brain didnt worked correctly

btw so it works in a multiboard
• For each (Integer A) from 1 to NumberOfPlayers, do (Actions)
• Schleifen - Aktionen
• Set A_HP[(Integer A)] = (Integer((Leben of CurrentHero[(Integer A)])))
• Multiboard - Set the text for MultiBrd item in column 4, row ((Integer A) + 1) to (String(A_HP[(Integer A)]))

#### Need_O2

Level 19
I'd rether substring(1,stringlength-3)

#### wd40bomber7

Level 11
Technically its not rounding, its truncating.
10.3948 becomes 10
10.9999 becomes 10
0.999999 becomes 0
It just chops off everything after the decimal point.

#### Eleandor

Level 21
that's basically the definition of rounding down...

Or at least what I understand as rounding down...

Status
Not open for further replies.

Replies
1
Views
623
Replies
3
Views
2K
Replies
18
Views
2K
Replies
1
Views
198
Replies
57
Views
3K