Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #12543 > unrolled thread
| Started by | D.J.W. van Kooten <vankooten@removethis.ic2.com> |
|---|---|
| First post | 2019-06-25 11:44 +0200 |
| Last post | 2019-06-26 12:40 +0200 |
| Articles | 7 — 3 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
Quickest way to show decimal seperator in SLE D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2019-06-25 11:44 +0200
Re: Quickest way to show decimal seperator in SLE Johan Nel <johan.nel@xsinet.co.za> - 2019-06-25 13:18 +0200
Re: Quickest way to show decimal seperator in SLE D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2019-06-25 17:01 +0200
Re: Quickest way to show decimal seperator in SLE "Jamal" <nospam@example.com> - 2019-06-25 13:42 -0400
Re: Quickest way to show decimal seperator in SLE D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2019-06-25 23:24 +0200
Re: Quickest way to show decimal seperator in SLE Johan Nel <johan.nel@xsinet.co.za> - 2019-06-26 08:37 +0200
Re: Quickest way to show decimal seperator in SLE D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2019-06-26 12:40 +0200
| From | D.J.W. van Kooten <vankooten@removethis.ic2.com> |
|---|---|
| Date | 2019-06-25 11:44 +0200 |
| Subject | Quickest way to show decimal seperator in SLE |
| Message-ID | <r1r3hepj1a7bbklfdeu8iquj4rvmu1ji58@4ax.com> |
I actually never had this question, to my surprise. A client asked me to show a decimal seperator in a numeric SLE, like this for European users: 100.000,25 or USA etc: 100,000.25 instead of 100000,25 (100000.25). What is the quickest way to achieve this? Probably RightSLE (which I never used so far) ? Or can I do this without external libs? Dick
[toc] | [next] | [standalone]
| From | Johan Nel <johan.nel@xsinet.co.za> |
|---|---|
| Date | 2019-06-25 13:18 +0200 |
| Message-ID | <qesvu9$fnr$1@dont-email.me> |
| In reply to | #12543 |
Hi Dick, Does the Picture clause of the SLE not work? :Picture := "999 999 999.99" :Picture := "999.999.999,99" Also look at SetDecimalSep()/SetThousandSep(). HTH, On 2019/06/25 11:44, D.J.W. van Kooten wrote: > I actually never had this question, to my surprise. > > A client asked me to show a decimal seperator in a numeric SLE, like > this for European users: > > 100.000,25 > > or USA etc: > > 100,000.25 > > instead of 100000,25 (100000.25). > > What is the quickest way to achieve this? > > Probably RightSLE (which I never used so far) ? Or can I do this > without external libs? > > Dick -- *Johan Nel* FOX member : Friend(s) of XSharp X# Website : https://xsharp.info George, South Africa
[toc] | [prev] | [next] | [standalone]
| From | D.J.W. van Kooten <vankooten@removethis.ic2.com> |
|---|---|
| Date | 2019-06-25 17:01 +0200 |
| Message-ID | <jgd4heh2g4lbo4jkkf6kuiujeumbrn0t3n@4ax.com> |
| In reply to | #12545 |
Replying on message of Tue, 25 Jun 2019 13:18:33 +0200 from Johan Nel: Hello Johan, > >Does the Picture clause of the SLE not work? > >:Picture := "999 999 999.99" >:Picture := "999.999.999,99" > >Also look at SetDecimalSep()/SetThousandSep(). > I didn't realize that I could use it for this so it sounds great but it seems to have a strange effect: I have added this amount in the field: 987654,12 (so 12 cents, SetDecimalSep is a comma over here) cPic:="999.999,99" Applying this picture gives: 654,120.00 so the first 3 numbers are gone and the 12 cents become 120 euro. Using my European amount "the American way"" cPic:="#999,999.99" applying this picture gives: 98.654,12 So it looks nearly how it should be but it totally leaves out the 7 of "987 etc"! Picture of the field is N14 decimal 2 and there's a plenty of room to show a large amount. What am I doing wrong? Dick
[toc] | [prev] | [next] | [standalone]
| From | "Jamal" <nospam@example.com> |
|---|---|
| Date | 2019-06-25 13:42 -0400 |
| Message-ID | <qetmdk$1af9$1@gioia.aioe.org> |
| In reply to | #12543 |
Dick,
You need to use the @R picture function. The following example shows how
it's done.
local n as float
// EU users
? "EU"
SetDecimal(2)
SetDecimalSep(Asc(","))
SetThousandSep(Asc("."))
n := 987654.12
? Transform(n, "@R 999,999,999.99") // 987.654,12
// US Users
? "US"
SetDecimal(2)
SetDecimalSep(Asc("."))
SetThousandSep(Asc(","))
n := 987654.12
? Transform(n, "@R 999,999,999.99") // 987,654.12
wait
Jamal
"D.J.W. van Kooten" wrote in message
news:r1r3hepj1a7bbklfdeu8iquj4rvmu1ji58@4ax.com...
I actually never had this question, to my surprise.
A client asked me to show a decimal seperator in a numeric SLE, like
this for European users:
100.000,25
or USA etc:
100,000.25
instead of 100000,25 (100000.25).
What is the quickest way to achieve this?
Probably RightSLE (which I never used so far) ? Or can I do this
without external libs?
Dick
[toc] | [prev] | [next] | [standalone]
| From | D.J.W. van Kooten <vankooten@removethis.ic2.com> |
|---|---|
| Date | 2019-06-25 23:24 +0200 |
| Message-ID | <3n35he1e44a4ugupnpe6rjmh94t3400vtn@4ax.com> |
| In reply to | #12547 |
Replying on message of Tue, 25 Jun 2019 13:42:13 -0400 from Jamal: Hello Jamal, Johan, Thanks for your help. The @R applied in the picture actually did not work; the Transform didn't work either (I tried to apply it in our SayIt routine which fills controls from the dbf). I did some more searching and guess what: this remark from Geoff of 30-4-2000 in this NG did do the trick: "Do those SLE's also have FieldSpecs? They override picture clauses." I removed the fieldspec and then the picture worked. I actually also had to remove the @R because with a @R I can not edit an existing value by adding a number in front of it; it will simply ignore it on save. But this seems to work fine: cPic:="999,999.99" SELF:oDCmCREDITLIM:Picture:=cPic This will shows as 123.456,78 (and it does no longer remove figures). So it does NOT make 123,456.78 from it as you might expect from the picture - so I expect it to follow the Europe settings. I'll have to check on my USA customer's system if there the same picture does show there as 123,456.78. I'll let you know for future reference. Dick
[toc] | [prev] | [next] | [standalone]
| From | Johan Nel <johan.nel@xsinet.co.za> |
|---|---|
| Date | 2019-06-26 08:37 +0200 |
| Message-ID | <qev3s8$hta$1@dont-email.me> |
| In reply to | #12548 |
Hi Dick, Glad you got it sorted. I think it actually use your Regional Settings somewhere in the Transform, but I might be wrong. Johan On 2019/06/25 23:24, D.J.W. van Kooten wrote: > Replying on message of Tue, 25 Jun 2019 13:42:13 -0400 from Jamal: > > > Hello Jamal, Johan, > > Thanks for your help. The @R applied in the picture actually did not > work; the Transform didn't work either (I tried to apply it in our > SayIt routine which fills controls from the dbf). > > I did some more searching and guess what: this remark from Geoff of > 30-4-2000 in this NG did do the trick: > > "Do those SLE's also have FieldSpecs? They override picture clauses." > > I removed the fieldspec and then the picture worked. I actually also > had to remove the @R because with a @R I can not edit an existing > value by adding a number in front of it; it will simply ignore it on > save. > > But this seems to work fine: > > cPic:="999,999.99" > SELF:oDCmCREDITLIM:Picture:=cPic > > This will shows as 123.456,78 (and it does no longer remove figures). > So it does NOT make 123,456.78 from it as you might expect from the > picture - so I expect it to follow the Europe settings. > > I'll have to check on my USA customer's system if there the same > picture does show there as 123,456.78. I'll let you know for future > reference. > > Dick -- *Johan Nel* FOX member : Friend(s) of XSharp X# Website : https://xsharp.info X# Forums : https://xsharp.info George, South Africa
[toc] | [prev] | [next] | [standalone]
| From | D.J.W. van Kooten <vankooten@removethis.ic2.com> |
|---|---|
| Date | 2019-06-26 12:40 +0200 |
| Message-ID | <9qi6he1u0p0npmh5i7uqovtj1qkrjusb0i@4ax.com> |
| In reply to | #12549 |
Replying on message of Wed, 26 Jun 2019 08:37:59 +0200 from Johan Nel: Hello Johan, > >Glad you got it sorted. I think it actually use your Regional Settings >somewhere in the Transform, but I might be wrong. > You are right again. I installed my program on the USA server of a client and with the same picture (and WITHOUT the fieldspec applied for the field) it showed something like 100,000.25 there. Thanks again for this simple and effective solution! Dick
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web