PxPlus User Forum

Twitter Twitter Twitter

Author Topic: System function NUM()  (Read 1117 times)

Danilo David

  • Member
  • **
  • Posts: 18
    • View Profile
System function NUM()
« on: March 12, 2020, 02:37:11 AM »
Hi,

Long time ago we had a problem about  the comma in NUM function and now we did encounter it again,

Example: When you have

A$="200,05" we expect in the NUM result is 200.05 but when you PRINT NUM(A$) the result is 20005


A$="200,,,,05"  PRINT NUM(A$) the result is 20005 also


We try also to change parameter 'TH'=0 and set 'DP'=46 but we get same result

Of-course this is very dangerous in our part, Did anyone encountered this also?



Thank you,

« Last Edit: March 12, 2020, 02:44:07 AM by Danilo David »

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 177
    • View Profile
Re: System function NUM()
« Reply #1 on: March 12, 2020, 04:37:16 AM »
The NUM function ignores TH and DP. That is what the documentation says. Example #2 exactly shows that.
We had to deal with this in the past as well. And it took a noticable amount of time to find the reason for our huge results.

The real question is:
Who/What passes decimal values written in national notation to your program? That is quite uncommon.