-
Notifications
You must be signed in to change notification settings - Fork 153
Localized Numbers
Dave DeLong edited this page Sep 18, 2015
·
1 revision
DDMathParser
2.0 adds support for parsing localized numbers. The most straight-forward way to parse a localized number is to pass the appropriate NSLocale
into the Expression
initializer.
There are some caveats to be aware of when parsing localized numbers:
- localized number parsing replaces the default number parsing
- scientific notation is not supported for localized numbers
- only the numbers are localized; no attempt is made to localize operators or directionality
- numbers are greedily matched. If you're parsing with a locale where
,
is the decimal separator, thensum(1,2,3)
is interpreted as1.2 + 3
. - whitespace is interpreted as being significant. For example,
sum(1, 2, 3)
is interpreted as1 + 2 + 3
.