Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / [SOLVED] Float 0.000000 to 0.00

Author
Message
Arbrakan
14
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 2nd Jan 2019 23:54 Edited at: 2nd Jan 2019 23:54
Hi all,

Happy new year !

I'm trying to print the number 0.60 with 2 points precision in the sense that the number be truncated (not rounded). There is a way to do that in Tier 1 ?





Thanks

The author of this post has marked a post as an answer.

Go to answer

smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 3rd Jan 2019 00:57
This post has been marked by the post author as the answer.
str("text",decimals)
so
print(str(kg,2)+" kg")
life's one big game
spec= i5 4ghz, 16gb ram, Nvidia 1070ti gpu
Arbrakan
14
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 3rd Jan 2019 01:07
Thanks !
Kakise
AGK Tool Maker
8
Years of Service
User Offline
Joined: 25th May 2016
Location: Paris
Posted: 3rd Jan 2019 15:28
You can also use the "Left" function to do it:



PSY
Developer
8
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 3rd Jan 2019 19:46
Quote: "You can also use the "Left" function to do it:"

That solution only works if the result is under 10.0 kg


PSY LABS Games
Coders don't die, they just gosub without return

Login to post a reply

Server time is: 2024-11-23 08:15:49
Your offset time is: 2024-11-23 08:15:49