Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
240
Formatting a number
posted

Hi,

I'm trying to format a number in a webmaskeditor control. It is readonly control and I want to display a number in fixed lenght. For example, if I have 45 it should be displayed as 000045. I have tried 000000 as inputmask but it doesn't work. Can someone please suggest me what should it be?

Thanks.

Az

Parents
No Data
Reply
  • 8607
    Offline posted

    Hello Az,

    It sounds like this should be done through code.  Set the mask to 999999 (entry not required).  Then once the user has entered a value (like on TextChanged or ValueChanged or EnterKeyPress event), you can check the length of the text of the editor.  If it's less than 6, then append 0s to the beginning of the text.

    You could also set the mask to 000000 (entry required) and handle the InvalidValue event to change the value.

    You can find out more about the WebMaskEditor events here.

    If this isn't helpful, I can forward your post to developer support and they should be able to assist you.

    Elizabeth Albert
    Localization Engineer

Children