LOLCODE allows converting a variable to a different types, such as from a
NUMBAR (float) to a
NUMBR (integer), using the
IS NOW A command.
It goes on a line between a variable’s name and a new type for the variable:
[variable] IS NOW A [type]
NUMBAR to a
NUMBR truncates the decimal portion of the floating point number.
For example, in the code below:
I HAS A powerLevel ITZ 9000.1 powerLevel IS NOW A NUMBR
powerLevel is changed to contain
Create a variable named
rating and assign it a
NUMBAR (float) value.
Convert it to
NUMBR (integer) and print it with