How to round variables

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Lunanatic

Currently working on an Idle Game. I wanted to multiple a var with 1.1. After 3 times I’m already at 3 decimals. So I would want to keep it there. Anyone has an idea on how to do that?

:bust_in_silhouette: Reply From: estebanmolca

Whit stepify function:

var n= stepify (1.3453543, 0.001)
    	print(n) #1.345

https://forum.godotengine.org/29110/how-to-round-to-a-specific-decimal-place