Displaying Real Attribute
Pete79
Member Posts: 11
Hi,
Anyone know how to show a real attribute to 2 decimal points only using display text i.e 00.00?. Its displaying really long numbers and I need to keep the size manageable.
Comments
prec(game.score,2)
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I could be wrong here (correct me if I am) but I thought the use of 'prec' is no longer recommended as it's less efficient than something like roundTo(game.score,2) because 'precision' first needs to convert the attribute it is rounding to text, perform the operation, then convert it back to a number, whereas round/roundTo performs its operation directly on the number. Ultimately it's probably not a big deal, but worth knowing if your game is doing a lot of rounding.
No, you're probably right @Socks. I don't do a ton of rounding so I just checked the Cookbook and went with that.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ah ! The Cookbook, last updated in the late 1800s.