SC Format: number fraction handling?

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
admin
Site Admin
Posts: 67284
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC Format: number fraction handling?

Post by admin »

PeterH wrote:1. test:

Code: Select all

  $NUM = 17,5;
Will work in next version, but you have to quote it since "," happens to be the argument separator in scripting syntax:

Code: Select all

$NUM = "17,5";
PS: Just improved this, now you can do this in Germany:

Code: Select all

$NUM = 17,5;

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: SC Format: number fraction handling?

Post by PeterH »

admin wrote:Not in v13.30.0006.
Sorry: you are right :oops:
I had downloaded 0006, but not moved it to install directory. So I had installed .0004

Seems I have to check the way I download and move...

Just tested $NUM = 17,5; (with .0007 :roll: ) :arrow: :appl:

Also tested $strDays = format(17,5, "#,0.00"); :arrow: :naughty: not OK
To be true: I didn't expect it to work :biggrin:

So it seems I have to learn that numbers with fractions should be in quotes - especially if in parameter lists...


Finally I see one real problem: scripts defining numeric constants with fractions are dependent from local language. :?
Not nice, I'd say :cry:

admin
Site Admin
Posts: 67284
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC Format: number fraction handling?

Post by admin »

PeterH wrote:So it seems I have to learn that numbers with fractions should be in quotes - especially if in parameter lists...

Finally I see one real problem: scripts defining numeric constants with fractions are dependent from local language. :?
Not nice, I'd say :cry:
1. Yes, no way around this at the moment. I might find a way later...

2. See 1.

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: SC Format: number fraction handling?

Post by armsys »

admin wrote:
PeterH wrote:So it seems I have to learn that numbers with fractions should be in quotes - especially if in parameter lists...
Finally I see one real problem: scripts defining numeric constants with fractions are dependent from local language. :?
Not nice, I'd say :cry:
1. Yes, no way around this at the moment. I might find a way later...
2. See 1.
Entschuldigen Sie! :roll: Werden nur deutsche Nummern Probleme mit XY? :?:
Thanks for your follow-up. Later, of course! :biggrin:

admin
Site Admin
Posts: 67284
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC Format: number fraction handling?

Post by admin »

Yes, only German (and wherever else comma is the decimal separator).

And the next version will solve all those little German problems. :biggrin:

Filehero
Posts: 2734
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: SC Format: number fraction handling?

Post by Filehero »

admin wrote:And the next version will solve all those little German problems. :biggrin:
Du hast die Rente wieder sichää gemacht?

admin
Site Admin
Posts: 67284
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC Format: number fraction handling?

Post by admin »

Ja, aber nur meine eigene. :biggrin:

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: SC Format: number fraction handling?

Post by Enternal »

Ich verstehe nicht Deutsch. Ich hoffe, es reparieren zu lassen. Viel Glück! :)

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: SC Format: number fraction handling?

Post by armsys »

Filehero wrote:Du hast die Rente wieder sichää gemacht?
Bundesnachrichtendienst vielleicht die Antwort für Sie. :mrgreen:
admin wrote:Ja, aber nur meine eigene. :biggrin:
Wow! Plötzlich sind wir alle Deutsch sprechen. Dank Don! :appl:

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: SC Format: number fraction handling?

Post by armsys »

Enternal wrote:Ich verstehe nicht Deutsch. Ich hoffe, es reparieren zu lassen. Viel Glück! :)
Ich wusste nicht, dass du ein Deutscher bist! Es tut uns leid Sir! :oops:

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: SC Format: number fraction handling?

Post by Enternal »

armsys wrote:
Enternal wrote:Ich verstehe nicht Deutsch. Ich hoffe, es reparieren zu lassen. Viel Glück! :)
Ich wusste nicht, dass du ein Deutscher bist! Es tut uns leid Sir! :oops:
Haha! Ich bin nicht deutsch. Ich wünschte, ich kann Deutsch sprechen, aber eigentlich spreche ich die Sprache Google Translate. :whistle:

LittleBiG
Posts: 1848
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: SC Format: number fraction handling?

Post by LittleBiG »

With Hungarian format settings:

Code: Select all

echo 17.5 * 2; /0
echo format(17.5); /2013.05.17
Not really as advertised.
(by the way the , is the decimal separator)

admin
Site Admin
Posts: 67284
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC Format: number fraction handling?

Post by admin »

:blackstorm: I need more icons... :evil:

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: SC Format: number fraction handling?

Post by PeterH »

  • v13.30.0008 - 2013-11-18 12:13
    + Scripting | Math Operations: Now, in German Windows, you can enter
    fractional constants in international format (decimal separator =
    dot) by leaving them unquoted. This is obviously the preferred way
    to go now for locale-independent scripts.
The idea is :appl: :appl: :appl:

Tried to fool it, but :appl:

OK: one problem :evil:
$k = .1;
It seems .1 isn't seen as numeric, so it's *not* converted to ,1
$k = ",1"
works as expected - so ,1 *is* a numeric constant...

admin
Site Admin
Posts: 67284
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: SC Format: number fraction handling?

Post by admin »

OK, fix comes.

Post Reply