leodido / moneylaundry

Collection of PHP utilities to filter and validate money with i18n in mind
MIT License
1 stars 0 forks source link

NAN uncurrency filtering only when currency is not mandatory? #11

Closed leodido closed 9 years ago

leodido commented 9 years ago

See this fixme.

If accepted as correct "NaN" will be filtered to double(NAN) only if currency symbol is set as not mandatory.

At the moment "NaN" is always filtered to double(NAN) in both situations (currency symbol mandatory or not mandatory.

Please feedback in pvt, @leogr.

leogr commented 9 years ago

NaN is a special case that may be enabled in lenient mode only, because NumberFormatter doesn't not handle the currency when try to format a double(NAN) and can not extract the currency when try to parse a "NaN" (the currency symbol is lost always).

For the same reason, it can not be accepted if currency symbol has been set as mandatory.

leodido commented 9 years ago

Ok, see #14.