User Preferences: Numbers string 3/4 digit grouping #116710
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116710
Loading…
Reference in New Issue
No description provided.
Delete Branch "ChengduLittleA/blender:numbers-grouping"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Added the functionality for switching 3/4 digit grouping for different conventions.
A lot of eastern cultures like Chinese uses 4 digit grouping for numbers such as
1234,5678
.This change allows user more choice for readability.
BLI_str_format_int_grouped
is renamedBLI_str_format_int_grouped_n
and a defaultvalue of 3 is given by the marco
BLI_str_format_int_grouped
to maintain the behavior ofold code.
Currently it only has 3 or 4 digit grouping, I believe there can be more formatting
styles available.
Currently affecting viewport and status bar numbers. The option is available in
User Preference > Interface > Editors
section.Also see D6179, ICU might be doable, but personally I think it's too heavy of an add for general processing of this format that's not used that frequently
986bbd89ad
toebbb3d242c
Typically, this kind of thing is handled by following the locale rather than every application configuring it separately.
Would it make sense to use these when Chinese language is used, rather than having a dedicated option?
If there is a need for an option, it feels more logical to have it next to other translation settings.
I'd prefer for it to go with translation setting too. So I might be to setting this value in the language set callback. The language enumeration doesn't seem to hold more data. I couldn't seem to find if there there is any "table" for language-associated configurations @Harley ? Looks like all it's relevant is the text file
datafiles/locale/languages
. Adding extra config in there seems ugly. Any existing ways we can link extra information with each local? (Otherwise I'll just manually add a table somewhere to look up)I don't know how well it will work for us, but I think this is what the locale in the C++ standard library or fmtlib is for. That is Blender would not have its own table specifying the formatting for each language, but rather get that information from or do the formatting through those APIs.
My struggle here is the conflation of locale and language. There might be a default language as part of a locale, but I don't want to infer locale from language.
For example, I am in Canada so I have my own computer set to show time in 12 hour format. Changing my language in the computer, or in Blender, to French does not mean I want to change the time format to 24 hour. Similarly for the use of period or comma as decimal separator. This varies by region, and those regions may have predominant language, but this isn't tied to the language. So people in France prefer "12.000,00", regardless of language.
You might prefer four-digit large number grouping, but I'd imagine that is what you want regardless of what language selected in Blender. This is something you set in the OS once outside of Blender and we should be honoring that setting.
Yes, there are some formatting differences that are per-language but this one is per region. Just like people in India will want their large number group formatting which is like 10,00,00,000. This shouldn't change if they show Blender in English or Chinese.
As mentioned by Brecht this would most likely involve using a standard library for the formatting of these things, rather than rolling our own, but using the current locale not the one taken from the blender output language setting.
It indeed doesn't necessarily have to depend on the chosen translation. Maybe it's rather a checkbox to use system settings for formatting numbers and dates.
There's also a problem with system-wise formatting like in this specific case of thousand/10-thousand marker. Our systems are generally just 3-digit group anyway, the local settings do affect some stuff like use period or comma. I just tested on my machine where no matter you are using
LC_ALL=zh_CN
oren_US
orhi_IN
,printf "%'.3f\n" 123123142153415142
will give you123,123,142,153,415,142.000
.Will test ICU and see if there's any difference, likely not. Since this is kind of a minor thing, people kinda get used to it, but it still feel weird in our languages.
@ChengduLittleA
Note that if we go down this path, one thing we can't get for any foreseeable future is display of numbers in inputs with comma decimal delimiter, as in "1.00,99". There are quite a few reasons, mostly related to our integration with python, but also for portability of scripts. There might be some solution for this, but you should probably assume we can't do this. That might result in some uncanny valley here if some numbers are regionally formatted.
Checkout
From your project repository, check out a new branch and test the changes.