NumberConverter should not ignore all non digit characters for BigDecimal type

Description

NumberConverter allow values like 'HelloWorld123' to be converter into 123 as BigDecimal. This can lead into wrong data, without user noticing.

There are some non digit characters like dot ('.') and comma (',') that we should allow, in order to ease reading of big numbers like:

1.000.000,12 or 1,000,000.12 depending on the Locale.

https://github.com/rjimgal/jbehave-bigdecimal-converter project demonstrates how '0x1A' is converted into BigDecimal 1, while one could expect NumberConverter to support hex inputs.

Activity

Show:

Mauro Talevi August 5, 2015 at 6:43 AM

Pulled with thanks.

RafaelJ August 4, 2015 at 12:59 PM

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created August 4, 2015 at 11:47 AM
Updated August 5, 2015 at 6:43 AM
Resolved August 5, 2015 at 6:43 AM

Flag notifications