Probably the system is returning &ua0 (non-break space, utf8 0xC2 0xA0 (c2a0)) and it is causing some internal mess with the Xojo mask handling, not expecting to deal with such kind of value.
Report the bug.
@Rick_A:
Your answer is creative. It would have been easy to check in the debugger.
There is a mess, but it is elsewhere… I am searching for the last three hours, polishing my code in between when I am at ideas changes loss…
Writing about creative answer apparently unlocked my brain. I found a creative way to remove the mess and my code (the other part I was debugging since… hours ago).
…and I was watching TV during the same time. ;-
The “0” mask should be only used as a sequence before and after the decimal point without intervening “#” (remove if 0) in the middle. Then “#” can be after the zeros, on the right side, after the decimal point, or after the zeros, to the left side, after the decimal point. So:
Var d As Double = 0
Var s As String = d.ToString("0,###") // Wrong
And the behavior was as expected, an exception.
And the other way around works, also as expected:
Var d As Double = 0
Var s As String = d.ToString("#,##0") // Ok
Just remember that Format(fmt) uses the current locale as output, and var.ToString(fmt) uses raw locale, it is, the decimal point is always “.”, and no thousands separator.
I will ask the question differently:
your mask seems to ask 3 digits after the decimal. Two of them are “optional” (can be omited), and the last one have to be 0 if no other value exists.
Strange demand.
Care to explain its use ?
OK: some people can code that way (to know if this works IMHO), but in real world, what can be its use ?