cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with decimal in Chrome

Former Member
0 Kudos

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+)?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

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:','}
Former Member
0 Kudos

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'}" />

Answers (0)