Custom format for WjInputNumber

Posted by: liemdt1811 on 22 April 2018, 4:44 pm EST

  • Posted 22 April 2018, 4:44 pm EST

    I am trying to display format like this: ‘00000.000’

    When user input 123, the control will display as ‘00123.000’.

    Currently I can only use format like ‘D5’ (00000) or ‘F3’ (0.000)

    Is there anyway to display as ‘00000.000’?

    Thank you.

  • Posted 23 April 2018, 9:54 pm EST

    Hi,

    The WjInputNumber supports only .NET standard numeric format strings. So the format you are trying is not accepted.

    Refer here for more info on .NET standard numeric format strings :- https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings

    However, if you want a custom format, consider using WjInputMask which meets your requirement.

    Refer to the following code snippet:-

    <wj-input-mask [mask]="'00000.000'" [promptChar]="'0'"></wj-input-mask>
    

    Here is an example of the same:- https://stackblitz.com/edit/angular-xvjhws?file=app%2Fapp.component.html

    ~Manish

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels