str2num problems with regional settings

str2num problems with regional settings - Messages

#1 Posted: 10/3/2012 12:48:43 PM
Martin Kraska

Martin Kraska

1,260 likes in 2,186 posts.

Group: Moderator

Hi

str2num has problems with nonstandard settings of decimal delimiter (komma) and function argument delimiter (semicolon). The error message indicates that the function tries to convert the internal argument separator (komma) to periods.

Best regards, Martin Kraska

Edit: Seems that the bug has been fixed:
[MATH lang=ENG]str2num(num2str(sys(1.2,2,2,1)))=sys(1.2,2,2,1)[/MATH]
str2num.sm (2.18 KiB) downloaded 256 time(s).
Martin KraskaPre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#2 Posted: 10/12/2012 3:43:26 AM
Davide Carpi

Davide Carpi

1,431 likes in 2,902 posts.

Group: Moderator

Another issue with regional settings.

When a variable name or a function name created using default settings (decimals->period,separator->comma) contains a semicolon (maybe in the subscript or not), opening the file with different settings (decimals->comma,separator->semicolon) cause an "empty stack" error (and the file can't be opened).


regards,

w3b5urf3r
semicolon_bug.sm (1.24 KiB) downloaded 268 time(s).
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 5/27/2013 6:26:06 AM
Davide Carpi

Davide Carpi

1,431 likes in 2,902 posts.

Group: Moderator

Wrote

Another issue with regional settings.

When a variable name or a function name created using default settings (decimals->period,separator->comma) contains a semicolon (maybe in the subscript or not), opening the file with different settings (decimals->comma,separator->semicolon) cause an "empty stack" error (and the file can't be opened).


regards,

w3b5urf3r



No chances to fix this? It's critical when sharing worksheets based on norms like Eurocodes or similars...


best regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
ioan92 5/27/2013 5:01:00 PM
#4 Posted: 5/29/2013 3:11:38 PM
Andrey Ivashov

Andrey Ivashov

2,291 likes in 3,849 posts.

Group: Super Administrator

I see the only way to fix it is to forbid semicolon symbol in variables/functions names. I'll do it.
I think instead I need to implement some common way to allow any characters to be used in names. But a bit later...

Best regards, Andrey Ivashov.
1 users liked this post
ioan92 5/29/2013 3:53:00 PM
#5 Posted: 5/29/2013 4:37:49 PM
Martin Kraska

Martin Kraska

1,260 likes in 2,186 posts.

Group: Moderator

Wrote


I think instead I need to implement some common way to allow any characters to be used in names.
Best regards, Andrey Ivashov.



One of the most missed characters is the % sign (as a unit name, '%:0,01), in order to avoid ugly constructs like in the attachment.
prozent1.png
Martin KraskaPre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Andrey Ivashov 5/31/2013 12:48:00 AM
#6 Posted: 5/29/2013 4:58:48 PM
Davide Carpi

Davide Carpi

1,431 likes in 2,902 posts.

Group: Moderator

Wrote

I see the only way to fix it is to forbid semicolon symbol in variables/functions names. I'll do it.
I think instead I need to implement some common way to allow any characters to be used in names. But a bit later...

Best regards, Andrey Ivashov.



mhhh... ok... I know, dot, comma and semicolon are special and sensible characters....
There are some unicode characters very similar ‚ ; I don't know if could be useful for the development of these exceptions (as dirty idea when an user is typing the name of the variable/function, Smath can convert "on the fly" the keyboard comma and semicolon input into this characters...)


thank you for any your effort

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Andrey Ivashov 5/31/2013 12:48:00 AM
  • New Posts
  • No New Posts