Allow localizing of formatting on decimal fields

Created on 28 June 2016, about 9 years ago
Updated 23 May 2025, about 2 months ago

Problem/Motivation

In the "Manage display" tab on a node you can set a format for field of type "Number (decimal). When you choose "Default" there are some settings for thousand marker and decimal marker, but these are not language specific. I would like them to be translatable or at least have an option like "Default for display language" and have them set automatically according to the locale of each language.

In some countries, 1,000 means one (1), whereas in other countries, the comma is used as a thousand separator, so it means one thousand (1000).

We can translate Label, Prefix, and Suffix for a field, but wouldn't it be great to also be able to set the Thousand marker and Decimal marker by language?

Steps to reproduce

Proposed resolution

Perhaps move the "Thousand marker" and "Decimal marker" settings from the "Manage display" page (/admin/structure/types/manage/municipality/display) to the field settings page? (/admin/structure/types/manage/article/fields/node.article.field_number), and live together with similar setting options, such as prefix suffix ?

It could be an option the user can select, where either a global character is used, or a language specific. The current select options could be updated to this:

Thousand marker

  • - None -
  • Decimal point
  • Comma
  • Space
  • Thin space
  • Default for display language <<< Add this option

Decimal marker

  • Decimal point
  • Comma
  • Default for display language <<< Add this option

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component

field system

Created by

πŸ‡ΈπŸ‡ͺSweden jeanfredrik

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024