0

I require to change my Number format in my CentOS 6.0 box. I am using "gnome desktop environment" version 2.28.2. I want to know from where can I change the default Number Format of the system.

I want to change this because in my system the number values are automatically changing as per default number format and I don't know what is that format.

In windows it is possible from control panel:
enter image description here

I tried searching into
1. System-> Administration-> Language
2. System-> Preferences-> Keyboard
3. System-> Preferences-> Input Method
But the required settings are not there.

If it is not possible by GUI then how to do it with command-line?

Update: Being specific, I want Digit grouping: 123456789 i.e. NOT including any comma, which is shown in above windows numbering format.

1
  • Why Downvote ??
    – TPS
    May 12, 2014 at 9:04

1 Answer 1

2

Linux refers to these settings as system-locale.

You can change your system locale by,

  • set environment variables to control the system locale. You can set these variables to be system-wide, or on a per-session basis:

LC_ALL

Overrides all LC_* environment variables with the given value

LC_CTYPE

Character classification and case conversion

LC_COLLATE

Collation (sort) order

LC_TIME

Date and time formats

LC_NUMERIC

Non-monetary numeric formats

LC_MONETARY

Monetary formats

LC_MEASUREMENT

Measurement units (Metric or Other)

LANG

The default value, which is used when either LC_ALL is not set, or an applicable value for LC_* is not set

TZ

Time zone

You can use the command locale to show your current locale.

locale -a displays all the locales that are currently installed on the machine. Make sure that the locale you select for LANG and LC_ALL is in the list that is returned by the command locale -a. The values that locale uses and returns are case sensitive, therefore copy them exactly when assigning them to an environment variable.

Consult the man-pages for more information like given below

Spefically for what you asked for, set

mon_grouping: Defines the size of each group of digits in formatted monetary quantities.

        mon_grouping   Formatted Value  ISO C String

         3;-1       123456'789       "\3\177"
         3          123'456'789      "\3"
         3;2;-1         1234'56'789      "\3\2\177"
         3;2        12'34'56'789     "\3\2"
         -1         1234567898       "\177"

Therefore your case should be

in LC_MONETARY

mon_grouping           -1

and also in LC_NUMERIC

grouping                -1

EDIT: To change these settings, edit your locale config file

/usr/share/i18n/locales/<your_locale>
7
  • but those variables are showing blank value when I am using echo Eg. echo $LC_NUMERIC
    – TPS
    May 12, 2014 at 6:32
  • Run locale as a normal user.
    – delta24
    May 12, 2014 at 6:35
  • please go through the update.
    – TPS
    May 12, 2014 at 7:05
  • Sorry to ask this, but how do I change this mon_grouping and grouping variables? Please edit accordingly.
    – TPS
    May 12, 2014 at 8:18
  • did above solution work for you?
    – delta24
    May 12, 2014 at 9:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .