How do I get Indian style comma in Currecny ?

Indian style comma in Currency as against Normal style goes like this :

Normal Style
1,234
123,456
12,345,678
1,234,567,890

Indian Style
1,234
1,23,456
1,23,45,678
1,23,45,67,890

Typically after thousand, we have comma after every two digits (against 3 digits of common style).

How can I achieve this with Fast Report ?

TIA
Milan.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 3:42AM
    use the format float function
  • edited 3:42AM
    gordk wrote: »
    use the format float function


    Can you guide us more on the subject ?
    Where can I find information about float function ? I am using FR for Xailer.
    What should be the formatting string ?

    TIA
    Milan.
  • edited 3:42AM
    use the format float function


    Can you guide us more on the subject ?
    Where can I find information about float function ? I am using FR for Xailer.
    What should be the formatting string ?
    I think you will have to write a custom formatting function.
    I checked in the Delphi and C++ help and all separators before the decimal point are referred to as thousand separators. There does not seem to be any support for what you want.
    What I wonder though is whether Windows itself allows your format to be set up under Regional Settings when India is set as location.

  • edited 3:42AM
    technisoft wrote: »
    technisoft wrote: »
    technisoft wrote: »
    use the format float function


    Can you guide us more on the subject ?
    Where can I find information about float function ? I am using FR for Xailer.
    What should be the formatting string ?
    I think you will have to write a custom formatting function.
    I checked in the Delphi and C++ help and all separators before the decimal point are referred to as thousand separators. There does not seem to be any support for what you want.
    What I wonder though is whether Windows itself allows your format to be set up under Regional Settings when India is set as location.

    Yes, windows allow this setting.
    I use Windows 8 and I can set the same in Regional Settings -> Currency -> Digit grouping as 12,34,56,789.
    Can that be of any help to us in FR ?

    TIA
    Milan.
  • edited 3:42AM
    Can someone help me in the matter ?
    Help will be highly appreciated as this is a burning issue for us.

    TIA
    Milan.
  • edited 3:42AM
    Yes, windows allow this setting.
    I use Windows 8 and I can set the same in Regional Settings -> Currency -> Digit grouping as 12,34,56,789.
    Can that be of any help to us in FR ?
    OK. Can you check what values Windows has in its FormatSettings structure?
    IIRC there is a CurrencyFormat property there.
    Then use the same formatting string in the FR component.
    If it does not work it is time to write a ticket for FR support to look into it.
    FR should handle everything supported by Windows.

    I am actually surprised that leaving the formatting string blank in a number field does not automatically default to the Windows setting but leaves the field blank altogether.
  • edited 3:42AM
    In windows actually there are 1. Currency Format and 2. Digit grouping. These together makes the proper Currency format. It seems FR does not have any ready solution for it.
    Can someone help me write a function to achieve this ?
    Can this function be called in OBP Event of the object ?

    TIA
    Milan.
  • edited 3:42AM
    Can someone help me in the matter ?
    Help will be highly appreciated as this is a burning issue for us.

    TIA
    Milan.

    Hi.

    This pascal function seems to work:
    function IndianFormat(s: String): String;
    var
      s1: String;
    begin
      s1 := s;                       
      if length(s) > 3 then
      begin
        s1 := ',' + copy(s, length(s)-2, 3);
        delete(s, length(s)-2, 3);
        while length(s) > 2 do
        begin
          s1 := ',' + copy(s, length(s)-1, 2) + s1;
          delete(s, length(s)-1, 2);                                                                    
        end;
        s1 := s + s1;
      end;
      Result := s1;                                         
    end;
    

    The function can be used in your memo: [IndianFormat('123456789')]

    Petter

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.