#run math
#subtract before and after scores that are scaled by 100
scoreboard players operation @s cmps_x -= @s cmps_y
#cmps_x is now the difference
#store difference to hp_diff
execute store result storage td.output hp_diff float 1 run scoreboard players get @s cmps_x
#store difference as whole numbers only
#cmps_z is whole numbers in final text
execute store result score @s cmps_z run data get storage td.output hp_diff .01
    #tellraw @a [{"text":"cmps_z/ whole number by itself:"},{"score":{"name":"@s","objective":"cmps_z"}}]
    #tellraw @a [{"text":"cmps_z is the issue, it's rounding after being scaled down to fit score"}]
#multiply whole number by 100 to scale for blank decimals
execute store result storage td.output hp_whole_diff float 100 run scoreboard players get @s cmps_z
#store scaled whole number
execute store result score @s xbounce run data get storage td.output hp_whole_diff
#xbounce is now whole number with 00 for decimals
#cmps_x is still whole numbner with decimals
#subtract whole #s from the one with decimals and store decimal into zbounce
execute store result score @s zbounce run scoreboard players operation @s cmps_x -= @s xbounce
#invert decimal to show correct decimal of dmg dealt
scoreboard players set td.decfix zbounce 100
execute store result score @s zbounce run scoreboard players operation td.decfix zbounce -= @s zbounce
execute if score td.decfix zbounce matches 100 run scoreboard players set @s zbounce 0