4D Blog

Home Product 4D Write Pro: Decimal point or comma for number alignment?

4D Write Pro: Decimal point or comma for number alignment?

October 27, 2020

Product

Numbers … big, small, very big, very small …  No matter their size, it’s always better if they’re easy to read. In most countries and languages, separator characters are usually used to separate thousands (or tens of thousands) and there is always a character to distinguish the decimal part from the rest of the number. When it’s time to align these numbers correctly in documents, “decimal tabulators” are used (which are based on the decimal separator character of the numbers).

But what if the documents contain numbers from different countries and the numbers aren’t formatted in the right way? Let’s take a closer look at this!

HDI: Decimal point or comma?

Some word processors assume the most general case: the decimal separator is either a period (aka point) or a comma. If we rely on this and align the numbers according to the first separator encountered from the right, everything will be fine.
Other word processors use what is defined at the system level in the regional parameters.

… Hmmmm … this isn’t so simple after all …

In the first case, large numbers formatted “American” style, such as 123,456,789 (without decimal places), won’t align correctly with 3.1416!
In the second case, “comma” numbers won’t align correctly if the expected decimal separator is a period.

Solution?

To overcome this problem, starting with 4D v18 R5, 4D Write Pro lets you specify this setting for each document. You can choose to align numbers either to:

  1. the point,
  2. the comma,
  3. the first one found,
  4. or finally, to the separator defined in the operating system.

In order to maximize compatibility (with MS Word in particular) option #3 is chosen by default when creating new documents. When migrating 4D Write documents to 4D Write Pro, the system-defined separator is still chosen by default.

In any case, this option can be modified to adapt to each document. It doesn’t modify the document contents in any way. It only modifies the layout of the content, when displayed.

If you have documents from various sources, this option will probably be of great help! If not, then don’t change anything and everything will continue to work “as before”.

Code sample

As you can see in the sample below, the number containing a point is not correctly aligned:

As long as a comma is defined as the decimal separator in the system, both of the following code samples will give the same result.

WP SET ATTRIBUTES([SAMPLE]WP; wk tab decimal separator; wk system)
//OR
WP SET ATTRIBUTES([SAMPLE]WP; wk tab decimal separator; wk comma)

blank

 

Discuss

Tags 4D Write Pro, v18 R5, v19, Word processor

Latest related posts

  • February 3, 2026

    4D Write Pro – Adding a margin automatically when bullets are set using standard actions

  • January 22, 2026

    Transform Static Documents into Actionable Knowledge with AIKit

  • January 22, 2026

    Deploy Fluent UI effortlessly in your 4D applications

Roland Lannuzel
Roland Lannuzel
• Product Owner & 4D Expert • After studying electronics, Roland went into industrial IT as a developer and consultant, building solutions for customers with a variety of databases and technologies. In the late 80’s he fell in love with 4D and has used it in writing business applications that include accounting, billing and email systems.Eventually joining the company in 1997, Roland’s valuable contributions include designing specifications, testing tools, demos as well as training and speaking to the 4D community at many conferences. He continues to actively shape the future of 4D by defining new features and database development tools.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • AI
  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor

Tags

4D AIKit 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R10 21 21 R2 Administration AI Artificial Intelligence Build application CI/CD Class Client/Server Code editor Collections Formula Listbox Logs Mail Microsoft 365 Network Objects OpenAI ORDA PDF Pictures Preemptive Programming REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience vscode Web Word processor
Subscribe to 4D Newsletter

© 2026 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy