Formatting Data – Overview
sap.ui.core.format
Intro
SAP Fiori applications are often used in an international context, and therefore need to be designed to adapt to different locales. Consistent rules for data formatting and characteristic data styles make the apps easy to work with, while enabling users to solve seamless workflows with cross-border processes and communication.
Types
Formatters can be applied to different types of data. SAPUI5 provides formatting capabilities to format dates, time, numbers, and comma-separated lists. It is also important to consider general formatting rules when displaying units of measurement.
Dates
The SAPUI5 date formatter supports 5 different date formats based on international rules: short, medium, long, full, and relative.
For more information, see Formatting Dates.
Examples of date formatting
Times
The time formatter supports 3 formats: short, medium, and long. The formatting depends on the locale defined in the browser settings.
For more information, see Formatting Time.
Examples of time formatting
Numbers
The number format depends on the data type (integer, float, currency, or percentage) and the relevant length (short, standard, or long).
For more information, see Formatting Numbers.
Examples of number formatting
Comma-Separated Lists
SAPUI5 provides a formatter for comma-separated lists. [internal_only]This test page shows how a comma-separated list renders in key SAP Fiori languages.[/internal_only]
Do not create comma-separated lists using hard-coded commas. The resulting format will be incorrect in some languages.
Comma-separated lists in different languages
Units of Measurement
The formatting for units of measurement depends on the type of unit, the language, and the respective control.
For more information, see Units of Measurement.
Examples of units of measurement
Resources
Want to dive deeper? Follow the links below to find out more about related controls, the SAPUI5 implementation, and the visual design.
Elements and Controls
- Formatting Dates (guidelines)
- Formatting Time (guidelines)
- Formatting Numbers (guidelines)
- Units of Measurement (guidelines)
Implementation
- Date Format (SAPUI5 API reference)
- List Format (SAPUI5 API reference)
- Number Format (SAPUI5 API reference)
Visual Design
- No links