I have a problem with formatting numbers for decimal places in different languages. For the CURRENCY control, the system accepts the correct format based on the language coming from the URL parameter; USA and DE
?sap-ui-language=DE or?sap-ui-language=US
For input fields that have an attribute type=Number, it always uses DOT as a decimal separator, regardless of language. Is there a solution to this problem? I have a dynamic sap.ui.table populated (for both rows and columns), and some rows have numeric fields and some rows as text fields, so I dynamically send data from the database, as shown below:
temp = new sap.m.Input(sColumnId + index,{ value:"{path: '" + sColumnId + "'}" , type:"{DATATYPE}", textAlign:"Right", liveChange:[handle_livechange,this], change:[handle_change, this] , editable:"{path:'EDITABLE', type:'sap.ui.model.odata.type.String'}" }
since some lines are text based, I cannot format the hard code as shown below:
type:'sap.ui.model.type.Float', formatOptions : { groupingEnabled: true, groupingSeparator: '.', decimalSeparator : ',', minFractionDigits: 2}}"
I tried a custom formatter, but somehow on a dynamic table my formatting function could not be found. I tried the onChange method for dynamic formatting, but in this case my javascript calculations do not work.
If I can control the formatting option based on the string value with the expression binding, it will also fix my problem, but the code below does not work.
temp = new sap.m.Input(sColumnId + index,{ value:"{path: '" + sColumnId + ", =${DATATYPE} === 'Number' ? type:'sap.ui.model.type.Float', formatOptions : { groupingEnabled: true, groupingSeparator: '.', decimalSeparator : ',', minFractionDigits: 2} : type:'sap.ui.model.type.String' }"