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.

Dark GDK / How to print decimal point numbers?

Author
Message
bigbrother 2000
20
Years of Service
User Offline
Joined: 15th Oct 2003
Location: UK
Posted: 23rd Feb 2007 10:43
Hello,

I have a double e.g. hello = 1.6

When I use the print command it prints it as a float such as 1.60000034.

How can I get it to print only the first decimal place so it reads 1.6 on screen.

Thanks for any help

hello = 1.6;
dbPrint(hello);

SNOW ISLAND : www.snowisland.co.uk
BEWARE THE MOON : www.bewarethemoon.co.uk
ALIEN INVASION : www.alien-invasion.co.uk
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 23rd Feb 2007 10:53
You will need to use sprintf to format the value first.



Paul.

Login to post a reply

Server time is: 2024-09-28 23:14:10
Your offset time is: 2024-09-28 23:14:10