Format numbers

  1. #1

    Format numbers

    How do I format a number like 12345 to display 12,345?
    Last edited by geoffrey.mcgill; Apr 17, 2014 at 4:31 PM.
  2. #2

    RE: Newbie: Format numbers

    hmmm. This is not a simple as I thought it was going to be. I think a dedicated <ux:CurrencyField> would be a good idea. I'll have to look into that idea and get back to you.
    Last edited by geoffrey.mcgill; Apr 17, 2014 at 4:16 PM.
    Geoffrey McGill
    Founder
  3. #3

    RE: Newbie: Format numbers

    Hi !

    Sure a dedicated "<ext:CurrencyField>" would be very handy but not only for US currency format... may it be used in formats like:

    1.234,56 and 1234,56 ...

    Thank's

  4. #4

    RE: Newbie: Format numbers

    yes, agreed.

    I've added this as a high priority item for us to implement. With some luck we'll be able to add a new <ux:CurrencyField> to the UX project.


    I'll keep this post update. Please feel free to <bump> this post if some time has passed and no updates have been made.*
    Last edited by geoffrey.mcgill; Feb 20, 2011 at 4:18 PM.
    Geoffrey McGill
    Founder
  5. #5

    RE: Newbie: Format numbers

    Does the following example help at all?

    Example

    <ext:TextField ID="TextField1" runat="server" MaskRe="/[0-9\$\.]/">
        <Listeners>
            <Change Handler="el.setValue(Ext.util.Format.usMoney(newValue.replace(/[$]/g, '')));" />
        </Listeners>
    </ext:TextField>
    The keystrokes are filtered to allow only numeric chars, then when the field is blurred the value is reformatted.


    Geoffrey McGill
    Founder
  6. #6
    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] textarea with line numbers
    By bogc in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 27, 2011, 11:37 AM
  2. Excel export, with numbers
    By FreddieBooo in forum 1.x Help
    Replies: 0
    Last Post: Jun 01, 2010, 5:46 AM
  3. serial numbers in grid
    By harshad.jadhav in forum 1.x Help
    Replies: 2
    Last Post: Mar 19, 2010, 2:32 AM
  4. [CLOSED] usMoney turns negative numbers into positive
    By harafeh in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 16, 2010, 7:25 PM
  5. Replies: 5
    Last Post: Feb 03, 2009, 11:49 AM

Posting Permissions