resulting MP from formula displays too many decimal values

Hi,

I am trying to make it so that whenever the player or enemy loses HP, they also lose an equal amount of MP.  I have written a custom formula script which uses derived percentages i.e. (1 - (b.def * 0.01))

I have attached the script if you want to take a look, but basically I just put "b.mp -= formula that calculates hp damage; formula that calculates hp damage"

It is kind of working, but the problem is that when my character gets attacked, it does the mp damage according to calculation, but it KEEPS all the decimal values such that my MP displayed is like 79.34545945094  and it looks smushed and bad.  I've attached a screenshot as an example.  Is there any way to make the resulting MP value only show digits to the left of the decimal point, like it does for HP?

Thanks so much in advance.

customformulascript.txt

scripterror.jpg
Convert the calculaton to integer

Code:
class Game_Battler < Game_BattlerBase  def custom_formula_normalatk(a,    value = a.atk * (1 - ((b.def * 0.01)) * ((0.01 + (b.mp * 0.01)))) *       (1 - (((b.luk * 0.25) * 0.01)) * (0.01 + (b.mp * 0.01)))    b.mp -= value.to_i    return value  endend
Works! Gosh thank you so much.

Original thread: https://forums.rpgmakerweb.com/threads/resulting-mp-from-formula-displays-too-many-decimal-values.36563/