You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to request a feature for PHP that adds support for the Indian numbering system, which is widely used in India and other South Asian countries. In this system, large numbers are formatted differently from the Western system. The formatting includes terms like lakhs (1,00,000) and crores (1,00,00,000).
For example, the number 1234567 should be formatted as 12,34,567 (instead of 1,234,567 in the Western system).
Motivation:
This feature will be particularly useful for developers in India and neighbouring countries who need to display numbers in a format that aligns with the Indian number system. Currently, PHP only supports the Western number formatting system, and there is no built-in function for Indian number formatting.
Proposed Solution:
New Function: Introduce a function like number_format_indian($number) that will format numbers according to the Indian numbering system.
Example: number_format_indian(1234567); // Output: 12,34,567
Customizable: Allow users to customize the separator if necessary (e.g., for different locales).
Edge Cases: Handle special cases like numbers with decimals (e.g., 1234567.89 should become 12,34,567.89).
Description
I would like to request a feature for PHP that adds support for the Indian numbering system, which is widely used in India and other South Asian countries. In this system, large numbers are formatted differently from the Western system. The formatting includes terms like lakhs
(1,00,000)
and crores(1,00,00,000)
.For example, the number
1234567
should be formatted as12,34,567
(instead of1,234,567
in the Western system).Motivation:
This feature will be particularly useful for developers in India and neighbouring countries who need to display numbers in a format that aligns with the Indian number system. Currently, PHP only supports the Western number formatting system, and there is no built-in function for Indian number formatting.
Proposed Solution:
New Function: Introduce a function like number_format_indian($number) that will format numbers according to the Indian numbering system.
Example:
number_format_indian(1234567); // Output: 12,34,567
Customizable: Allow users to customize the separator if necessary (e.g., for different locales).
Edge Cases: Handle special cases like numbers with decimals (e.g., 1234567.89 should become 12,34,567.89).
Example in Action:
Alternatives:
We could also consider enhancing the existing
number_format()
function by adding an option for the Indian number format.Impact:
Backward Compatibility: This feature will be optional and won't affect existing functionality.
Localization: It would make PHP more useful for applications targeting users in India and other South Asian countries.
The text was updated successfully, but these errors were encountered: