8.3Auto Text to Number
An evaluator may have the â€œAuto Text to Numberâ€� feature, which means
that the â€œConvert to Numberâ€� function, when receiving a Text value or
a Reference to a Text value, converts the Text into a Number,
typically through calling the VALUE() function. This feature can be
convenient if files never change locale, but in today's international
environment, this feature can easily lead to data files that look
correct but give subtly wrong answers, especially when shared with
users who use a different locale. This can be a problem even when the
documents never leave a small geographical area, since users may
choose a locale they are familiar with that is different that the one
expected by the document sender.
This is perfectly solvable.
Let me explain.
The environment needs to be split in two. One internal representation
and one UserInterface representation.
The internal representation holds a standardized locale. And the
UserInterface has also a local.
The programs can compare the two and calculate forth and back between
those, while the internal representation remains stable.
Means documents that can be read with any local because it's not
dependent upon the UI localization.
User can input things that get (in a stable way) converted to the
internal representation and forth to display everything.
Allows for doing a Auto Text to Number.
Works as following:
A preparing function takes the text and converts it to the internal
representation locale according to localization transformation rules.
Now our Function can take that, which is the same everywhere, and
converts it according to the internal representation local.
The program then, for showing, does the regular transformation between
internal representation locale and user interface locale.
There are of course strange edge cases that will always be very
difficult to solve.
But having a simple way to do simple things looks very good possible
in a standards-compliant locale-independent way.
This also allows collaboration wit people from different locale on the