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 DBPro Corner / numbers...

Author
Message
Allie
16
Years of Service
User Offline
Joined: 5th Jan 2008
Location: Melbourne, Aus
Posted: 19th Jan 2008 12:03 Edited at: 21st Jan 2008 09:05
Just wanted to know how to convert a integer number to a dollar value, thanks for the reply its much appreciated.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 19th Jan 2008 18:32 Edited at: 19th Jan 2008 18:34
So you have an integer and you want to make it a money amount? In that case, use something like this:

Edit: I modified it into a function so you can use it easily:




[i]"Grow food in dirt? Save time — eat dirt."[i]
Allie
16
Years of Service
User Offline
Joined: 5th Jan 2008
Location: Melbourne, Aus
Posted: 19th Jan 2008 19:02
Fantastic thanks
Allie
16
Years of Service
User Offline
Joined: 5th Jan 2008
Location: Melbourne, Aus
Posted: 19th Jan 2008 19:38 Edited at: 19th Jan 2008 21:00
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 19th Jan 2008 19:49
Ah, sorry about that, I got two strings mixed up when I changed it into a function. This should work:




[i]"Grow food in dirt? Save time — eat dirt."[i]
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 20th Jan 2008 06:17
Why have you removed your original post?

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 20th Jan 2008 16:01
Yes, it's nice for other people to know what you asked so they can benefit from the answer.


[i]"Grow food in dirt? Save time — eat dirt."[i]
Allie
16
Years of Service
User Offline
Joined: 5th Jan 2008
Location: Melbourne, Aus
Posted: 20th Jan 2008 16:54 Edited at: 20th Jan 2008 21:02
sorry...Just wanted to know how to convert a integer number to a dollar value, thanks for the reply its much appreciated.
Dabbler
17
Years of Service
User Offline
Joined: 3rd Mar 2007
Location: Minnesota
Posted: 20th Jan 2008 18:22
Try this one:




Whatever...
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 20th Jan 2008 19:32
and


?

Though it is DBP...

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Allie
16
Years of Service
User Offline
Joined: 5th Jan 2008
Location: Melbourne, Aus
Posted: 20th Jan 2008 21:03
wow thanks for the replys, much appreciated they are excellent.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 21st Jan 2008 01:26
Can you edit the OP please to put your original question back - just in case anyone else asks the same question in the future.

I'll edit the topic title when you've done it...

TDK_Man

Allie
16
Years of Service
User Offline
Joined: 5th Jan 2008
Location: Melbourne, Aus
Posted: 21st Jan 2008 12:50
the code from sven b,
Is there a way to round off the extra numbers displayed? it says $19.3500001835, im guessing its mixing your code with dabblers code? if i use int, it shows only 19, thanks for help, al

Login to post a reply

Server time is: 2024-09-27 10:33:49
Your offset time is: 2024-09-27 10:33:49