Add configurable thousands separator for page number formatting#862
Open
kunalray1993 wants to merge 2 commits intotecnickcom:mainfrom
Open
Add configurable thousands separator for page number formatting#862kunalray1993 wants to merge 2 commits intotecnickcom:mainfrom
kunalray1993 wants to merge 2 commits intotecnickcom:mainfrom
Conversation
williamdes
reviewed
Apr 7, 2026
williamdes
approved these changes
Apr 7, 2026
williamdes
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses the issue reported here: #861
Overview
This pull request introduces the ability to configure the thousands separator used by
TCPDF_STATIC::formatPageNumberandTCPDF_STATIC::formatTOCPageNumber.Previously, these functions used a hard-coded dot (
.) as the thousands separator, which caused issues for users in locales that use different conventions (comma, space, or no separator). This PR adds flexibility by allowing developers to set the separator at runtime.Background
The original implementation:
This forced all page numbers and TOC entries to use a dot separator regardless of locale. The enhancement makes the formatting customizable without modifying core files.
What This PR Adds
TCPDF_STATIC::$thousands_separatorTCPDF_STATIC::setThousandsSeparator($separator)TCPDF_STATIC::formatPageNumberTCPDF_STATIC::formatTOCPageNumberto use the configurable separator.
Benefits
.)Example Usage
Backward Compatibility
Additional Notes
Happy to update the PR if maintainers prefer an alternative naming convention or a broader locale configuration approach.