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.

AppGameKit Studio Chat / Print on screen with 2 decimal places

Author
Message
Gary Hunt
User Offline
Joined: 11th Mar 2021
Location:
Posted: 11th Mar 2021 16:16
Hi all, I'm writing a programme that requires cash amounts to be displayed with 2 decimal places. (i.e. £5.00)

Amount#=5.00
print "Cash £ "';amount#;

it only prints £5

I've looked through all the print commands and can't find the one that locks varibles to display with 2 decimal places.

Many Years ago I use to use Amos Basic on the Amiga in this programme you used the command Print Using "###.##" to force varible to use 2 decimal places.

Is there a simular command in Dark Basic ?

Regards
Gary Hunt
Virtual Nomad
Moderator
15
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 11th Mar 2021 16:39 Edited at: 11th Mar 2021 16:40
Try something like:
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
Raven
16
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 11th Mar 2021 19:34


Although, as a note this forum is for AppGameKit Studio... you might want to scroll down the Forum List for Dark BASIC / Dark BASIC Professional
Gary Hunt
User Offline
Joined: 11th Mar 2021
Location:
Posted: 12th Mar 2021 08:37
Thanks Guys, I know someone would know how to do it.

Kind Regards
Gary Hunt

Login to post a reply

Server time is: 2021-07-31 10:32:52
Your offset time is: 2021-07-31 10:32:52