Updated: November 30, 2022

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
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
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
Examples of number formatting

Comma-Separated Lists

Comma-separated lists are typically used to show a series of values in a single line. The rendering of comma-separated lists depends on the locale.

Developer Hint
SAPUI5 provides a formatter for comma-separated lists.

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
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
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

Implementation