Results 1 to 7 of 7

Thread: Need currency converter function

  1. #1

    Default Need currency converter function

    Hi I am using Extjs version 6.5.1.
    I need a function to convert the given number to given currency foramte.
    For example my number is 123456, and my currency foramt is $.
    I want this number is dollor foramte like $123,456.

    And i want to conevert the same number in rupee foramet(₹).
    So then i want an output like ₹1,23,456.

    i want to convert the same number into pound (£) also.

    I found one function i.e Ext.util.Format.currency(123456, '$', 0);
    It is converting the given number to dollor($) formate only.

    If i give the rupee (₹) in the same function it is not formating into rupee formate.

    Please give me one function to convert the given number to given currency formate.

    It would be helpful to me.


    Thanks In Advance
    Kamalakar Reddy

  2. #2
    Sencha - Forum Administrator
    Join Date
    Sep 2017
    Posts
    1,006
    Answers
    5

    Default

    Thank you so much for your post. I apologize for the delay. I have shared this with the support staff to look into at their earliest convenience. Your patience is greatly appreciated! We do suggest using the support portal when you need assistance with a capability of a Sencha product, you have identified a situation where a products behavior is inconsistent with the product documentation and might indicate a software bug, or when the communication between you and Sencha needs to be private.

    Thanks again,

    Michele


  3. #3
    Sencha User
    Join Date
    Sep 2007
    Location
    Phoenix AZ
    Posts
    98
    Answers
    3

    Default

    This worked as expected in extjs 6.7.0


    Code:
                }, {
                    xtype: 'displayfield',
                    label: 'number',
                    html: Ext.util.Format.currency(999999, '€', 0)
                }, {
                    xtype: 'displayfield',
                    label: 'number',
                    html: Ext.util.Format.currency(999999, '₹', 0)
                }
    -Mark

  4. #4
    Sencha Premium User wemerson.januario's Avatar
    Join Date
    Nov 2008
    Location
    Goiânia - GO, Brazil
    Posts
    872
    Answers
    15

    Default

    you can also use renderer for displayfields

    https://fiddle.sencha.com/#view/editor&fiddle/2qvk
    Wemerson Januario @JanuarioCoder
    Novanti Tecnologia, Sencha MVP/ Ext JS Consultant
    ____________________________________________
    Hire me on UpWork:

    GitHub
    https://github.com/wemersonjanuario

    Treinamento e Consultoria Ext JS. QUALIFIQUE-SE JÁ!

  5. #5

    Default

    Thanks for you kind replay....
    But this is not the exact solution...
    Ext.util.Format.currency(999999, '&euro', 0) and Ext.util.Format.currency(999999, '₹', 0); both are giving the same result like "&euro999,999" and "₹999,999" except symbols.
    My requirement is if i give the Ext.util.Format.currency(999999, '₹', 0); then the formate currency should be ₹9,99,999 and if i give Ext.util.Format.currency(999999, '$', 0) then the currency should be "$999,999".
    Based
    on symbol only it should convert the Rupee formate(₹9,99,999) and dollor format($999,999).
    In both cases ',' seperation is different.

    Your replay would be very helpful to me.


    Thanks
    Kamalakar

  6. #6
    Sencha User
    Join Date
    Sep 2007
    Location
    Phoenix AZ
    Posts
    98
    Answers
    3

    Default

    Ok. I see your issue. https://www.npr.org/sections/krulwic...lionaire-india This explains how the comma is used with regard to ruppees


    I don't think that the Ext.util.Format is setup for that. You should be able to put something together to deal with this.

    Sorry I can't be more help.

  7. #7
    Ext Support Team
    Join Date
    Jan 2018
    Posts
    533
    Answers
    7

    Default

    Hello Kamalakar,

    Since there is no such Function for each currency according to country-specific format, You will need to use Regex/custom function for it.

    Regards,
    Kumar.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •