Hello,
Please can someone let me know if it is possible to remove the decimal
point in an amount using a function?
i.e. replace 340.23 to 34023
replace 103456.23 to 10245623.
Thanks,
Brett
|
|
0
|
|
|
|
Reply
|
brettmanning24 (2)
|
2/8/2010 11:00:12 AM |
|
On Mon, 8 Feb 2010 03:00:12 -0800 (PST) TyreDude <brettmanning24@gmail.com>
wrote:
:>Please can someone let me know if it is possible to remove the decimal
:>point in an amount using a function?
:>i.e. replace 340.23 to 34023
:> replace 103456.23 to 10245623.
A combination of POS and DELSTR will do it. I leave the exercise to you.
--
Binyamin Dissen <bdissen@dissensoftware.com>
http://www.dissensoftware.com
Director, Dissen Software, Bar & Grill - Israel
Should you use the mailblocks package and expect a response from me,
you should preauthorize the dissensoftware.com domain.
I very rarely bother responding to challenge/response systems,
especially those from irresponsible companies.
|
|
0
|
|
|
|
Reply
|
Binyamin
|
2/8/2010 11:25:43 AM
|
|
TyreDude wrote:
> Hello,
>
> Please can someone let me know if it is possible to remove the decimal
> point in an amount using a function?
>
> i.e. replace 340.23 to 34023
> replace 103456.23 to 10245623.
>
> Thanks,
>
> Brett
Hi!
Try ChangeStr(needle,haystack,newneedle)
say ChangeStr('.',123456.78,'')
/dg
|
|
0
|
|
|
|
Reply
|
danfan46
|
2/8/2010 12:25:25 PM
|
|
On Mon, 8 Feb 2010 03:00:12 -0800 (PST), TyreDude
<brettmanning24@gmail.com> wrote:
>Please can someone let me know if it is possible to remove the decimal
>point in an amount using a function?
If the amount is an amount of money, so you'll know that there are
only ever two decimal places, then:
Pennies = money*100 /* Will do the job */
If your "money" variable can have more than two decimal places (as
often happens after applying tax calculations) then you can round it
first
Money = format(money,,2)
Or do it all in one go:
Pennies = format(money,,2)*100
|
|
0
|
|
|
|
Reply
|
Swifty
|
2/8/2010 1:51:12 PM
|
|
On Mon, 8 Feb 2010 17:51:53 -0000, "Robert AH Prins"
<spamtrap@prino.org> wrote:
>space(translate(money, ' ', '.'), 0)
Or: changestr('.',money,'') /* That's two single quotes */
This was added in IBM Object Rexx, so is also in Open Object Rexx. I
don't know about the others.
|
|
0
|
|
|
|
Reply
|
Swifty
|
2/8/2010 5:05:07 PM
|
|
"TyreDude" <brettmanning24@gmail.com> wrote in message
news:21862dc1-5825-481f-8bdb-4576c5ed41b8@z26g2000yqm.googlegroups.com...
> Hello,
>
> Please can someone let me know if it is possible to remove the decimal
> point in an amount using a function?
>
> i.e. replace 340.23 to 34023
> replace 103456.23 to 10245623.
space(translate(money, ' ', '.'), 0)
--
Robert AH Prins
robert dot ah dot prins on gmail
|
|
0
|
|
|
|
Reply
|
Robert
|
2/8/2010 5:51:53 PM
|
|
|
5 Replies
697 Views
(page loaded in 0.363 seconds)
|