Skip to Content
0

Problem with decimal in Chrome

May 17, 2017 at 07:14 AM

198

avatar image

Hi,

i use a Edm.Decimal-Value in my oData. In Internet Explorer everything works well.

But in Chrome when i bind the Value:

<Input type="Number" value="{ path: 'Monatssumme',mode:'TwoWay',type: 'sap.ui.model.odata.type.Decimal', constraints:{ precision:6,scale:2}}" />

i got the Error:

The specified value "2,00" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Michael Roger May 17, 2017 at 08:49 AM
0

Found the problem and the soultion...

the problem was

type="number"

which is handled in an other way on chrome...so i changed my binding to the following:

added

formatOptions:{decimalSeparator:','}
Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

3,0 isn't a number in any programming language.

3.0

is the way to go ;) if you need to display numbers in a different way, you should use the formatter.

<Input type="Number" value="{ path: 'Monatssumme',mode:'TwoWay',type: 'sap.ui.model.odata.type.Decimal', constraints:{ precision:6,scale:2}, formatter: '.formatterName.methodName'}" />
0