AnsweredAssumed Answered

Parsing text into numbers - how hard can it be?

Question asked by wimmmmm on Nov 9, 2018
Latest reply on Nov 9, 2018 by wimmmmm

Can someone explain me what all the rules are Filemaker is using to go

  • from a series of characters, including a chosen decimal divider, say "228.34"
  • to a number, in this case hopefully 228.34 - but in practice 22834


My setup:

  • Filemaker Pro Advanced 17
  • Mac OS 10.13
  • UK locale, so on my Mac, the decimal separator is "."
  • using Belgian keyboard (input source) (yess, I'm using AZERTY :-) )


The db itself runs on FMServer 17:

  • on MacOS 10.13, using BE locale. When importing data into the db, FM clearly follows the FM Advanced settings, not the server settings. So I concluded the FMS locale settings do/should not play a role here.
  • no scripts are running on server, all runs in FM Advanced itself


I'm aware of locale settings, that's why I have UK as first locale. UK has decimal separator set to "."


I'm looking at the Expression editor, and I'm baffled I have to write code like

GetAsNumber ( Substitute ( "228.34" ; "." ; ","  ) ) 

to get the desired result 228.34


Why is

GetAsNumber ( "228.34" )

giving me 22834 ?


And how could I make this work the way I expect?


To put it to the max: on my layouts I format the currency fields as "use system settings".

And the value above shows as 228.34


So when showing the single same field value

    • in calculations, I see 228,34
    • in a layout using system settings, I see 228.34