I have looked at the various modules that might be involved with this (such as Format Number, Currency or Measured Value Field), and hope I've picked the one that this issue should be posted to. If it should be posted elsewhere, please let me know.

Indian currency amounts are written in the format: 10,20,30,400.50 (http://en.wikipedia.org/wiki/Indian_numbering_system) and read as 10 crore, 20 lakh, 30,400 rupee and 50 paise
So a crore = 100 lakh, a lakh = 100,000 rupee, and a rupee = 100 paise.

The "thouands separator" is thus used not every three digits left of the decimal (before digits 3,6,9,... counting left from the decimal point) but rather at specific positions (before digits 3,5,7 counting left from the decimal point).

Is there a way to support this now (that I haven't figured out)? If not, could you please consider adding it?

Thank you.

Comments

markus_petrux’s picture

Project: Formatted Number » Format Number API

Moving to Format Number API issues queue, which is the module that implements the functions that Formatter Number CCK uses.

Here we would need to implement an additional site/user option to select thousands separator placement, and then implement an as optimized as possible function that applies this option. We need 2 versions of this function, one for PHP and another one for javascript.

markus_petrux’s picture

Status: Active » Postponed

I do not plan to work on this, mostly due to lack of time. I'm marking this issue as postponed until someone can come up with a patch.

@ailgm: Are you planning to work on this?

ailgm’s picture

I'd like to see it implemented, but I don't have sufficient knowledge to accomplish it.

Perhaps someone else could volunteer, who is also interested in the idea?

markus_petrux’s picture

Status: Postponed » Closed (fixed)

A few months with no more feedback. I'm going to close the issue for clean up of the queue. Of course, it can be re-opened if someone wishes to work on it.

ailgm’s picture

Status: Closed (fixed) » Postponed

We're still interested in this. Can we please leave it in the queue, so that it might get picked up and dealt with some day?

Hanno’s picture

in format_number.js you could change the function Drupal.formatNumber.

    // Add thousands separator.
    for (var i = 0; i < digits.length; i++) {
	if  (format =="Indian")  { //to be done, there should be a test if Indian formatting should be applied
	integer_part += (((i ==3 || ((i % 2) == 0 && i > 3)) ? Drupal.settings.format_number.thousands_sep : '') + digits[i];
      } else {//western style
           integer_part += ((i % 3) == 0 && i > 0 ? Drupal.settings.format_number.thousands_sep : '') + digits[i];
digits[i];
}
}

Not tested, and there should be a test if Indian formatting should be applied. I think India uses the same character code for a comma in numbers as the western style, so we can not test for the thousands separator (Drupal.settings.format_number.thousands_sep;)

NB: It seems this javascript the only place and the thousands mark is only added by javascript, or should it also be added in a php function?

Hanno’s picture

Issue summary: View changes

link to wikipage for more info about the Indian numbering system