Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
how do i add currency value which i retrieve from the database to a number
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
omesh moreku
#1
how do i add currency value which i retrieve from the database to a number
Sep 30 '10, 01:27 PM
R 20.22 + StrToInt(Edit1->Text);
how do i deal with this R
weaknessforcats
Recognized Expert
Expert
Join Date:
Mar 2007
Posts:
9214
#2
Sep 30 '10, 02:57 PM
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.
Comment
Post
Cancel
donbock
Recognized Expert
Top Contributor
Join Date:
Mar 2008
Posts:
2427
#3
Oct 1 '10, 11:52 AM
Would you have to convert from one currency to another if the symbol in the file weren't 'R'?
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment