Fiori Globalization实现的一个具体例子 - 关于数字显示格式的处理

简介: This issue is copied from one of Jerry’s workshop regarding Fiori Globalization implementation.You might observe the same number value but displayed with different format if you log on the same system with different user.

This issue is copied from one of Jerry’s workshop regarding Fiori Globalization implementation.

You might observe the same number value but displayed with different format if you log on the same system with different user.


image.png


The user with Decimal Notation setting " " will see the format “1.880,00” and setting “Y” will see “1 880,00”. What has happened under the hood?



image.png



If you monitor the network tab in Chrome development tool when Fiori launchpad is initialized for the very beginning, you can find the http request below:


image.png


The response contains the Defaults user setting stored in ABAP backend. The attribute “numberFormat” is related to the number format being displayed.


image.png


In Configuration.js, the corresponding enumeration variable is defined for each type of number format.


image.png


The main logic for number format is implemented in file NumberFormat.js. As the variable name has already given a good hint, the integer part and fraction part of 1880.00 are parsed and stored into the two variables separately.


image.png


The logic of the following code:

Since a number is displayed as several groups and each group consists of THREE digits, so in code 627, the position of group is calculated by MOD operation against 3.

For user setting “Y”, the group separator character is " " and decimal separator is “,” , stored in corresponding attribute in variable oOptions.

image.png

相关文章
|
C# 前端开发
WPF DatePicker默认显示当前日期,格式化为年月日
原文:WPF DatePicker默认显示当前日期 WPF的日历选择控件默认为当前日期,共有两种方法,一种静态,一种动态。 静态的当然写在DatePicker控件的属性里了,动态的写在对应的cs文件里,具体请看下面。
6440 0
|
5月前
QT中edit控件限制输入数值以及进制转换方法
QT中edit控件限制输入数值以及进制转换方法
|
XML JSON 数据格式
SAP UI5 日期类型 sap.ui.model.type.Date 的显示格式问题分析
SAP UI5 日期类型 sap.ui.model.type.Date 的显示格式问题分析
|
存储 Web App开发 开发者
SAP UI5 日期类型 sap.ui.model.type.Date 的解析格式问题分析
SAP UI5 日期类型 sap.ui.model.type.Date 的解析格式问题分析
|
XML Web App开发 API
关于 SAP UI5 参数 $$updateGroupId 前面两个 $ 符号的含义
关于 SAP UI5 参数 $$updateGroupId 前面两个 $ 符号的含义
|
JavaScript
VUE element-ui之table表格内容添加千位分割符/货币格式
VUE element-ui之table表格内容添加千位分割符/货币格式
547 0
VUE element-ui之table表格内容添加千位分割符/货币格式
SwiftUI—如何对Text视图里的日期进行格式化
SwiftUI—如何对Text视图里的日期进行格式化
676 0
SwiftUI—如何对Text视图里的日期进行格式化
Fiori Globalization实现的一个具体例子 - 关于数字显示格式的处理
Fiori Globalization实现的一个具体例子 - 关于数字显示格式的处理
Fiori Globalization实现的一个具体例子 - 关于数字显示格式的处理
SAP Fiori globalization实现原理之Amount显示的截断原理
SAP Fiori globalization实现原理之Amount显示的截断原理
103 0
SAP Fiori globalization实现原理之Amount显示的截断原理
|
Web App开发
SAP UI5应用里类型为Edm.DateTime的日期控件设计原理
SAP UI5应用里类型为Edm.DateTime的日期控件设计原理
132 0
SAP UI5应用里类型为Edm.DateTime的日期控件设计原理