By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,853 Members | 2,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,853 IT Pros & Developers. It's quick & easy.

how do i add currency value which i retrieve from the database to a number

P: n/a
R 20.22 + StrToInt(Edit1->Text);
how do i deal with this R
Sep 30 '10 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 5K+
P: 9,197
You might consider using ftoa to convert the real to a string.

Then you should be able to parse the string converting 20.22 as a string to 2022 as an int. That is, keep things in pennies.

The only time you would need a decimal is when you report on the value. You could write a display function that would display 2022 as $20.22.
Sep 30 '10 #2

Expert 100+
P: 2,398
Would you have to convert from one currency to another if the symbol in the file weren't 'R'?
Oct 1 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.