Networked float decimal place limit?

Hi guys, once you all helped me out and got the ball rolling, I’ve made lots of good progress on my gamemode :slight_smile:

Now I’m adding a currency system, and there’s something that could add an irrational amount of money to someone. How do I set a float to have a decimal place limit of hundredths?

I’m using ply:SetNetworkedFloat, and there’s a part of the code that has:


  killer:AddMoney( 10 * (killer:GetNWFloat( 'multiplier' ) ) )
  killer:SetNetworkedFloat( 'multiplier' , ( killer:GetNWFloat( 'multiplier' ) * 1.4 ) )

So you could see how the decimals could get out of hand on the HUD :stuck_out_tongue:

thanks!

math.Round

Awesome, that’s exactly what I was looking for. But now, the variable just isn’t changing at all :frowning: I have


    killer:SetNetworkedFloat( 'multiplier' , math.Round( ( killer:GetNWFloat( 'multiplier' ) * 1.4 ) ), 2 )

EDIT: Recoded it to this, but now it just isn’t rounding lol.


    killer:SetNetworkedFloat( 'multiplier', math.Round( ( killer:GetNWFloat( 'multiplier') * 1.4 ), 2 ) )