Problem here is when user want to type with decimal values, say for example 30.05, then after entering 30, and after entering the dot , quickly the dot disappears and whatever entered it becomes whole number like 3005.

Decimal box as any other NumberInputElement is locale specific. So in order to get a specific formatting use the locale like this.
If you don't specify it, it will assume the server default locale. The format string will ususally be the same but the formatted output and parsed input will use locale specific group- and decimal-separators.

Comments

if you want to notify the server of the user typing you might just listen to the "onChanging" event on the server, this will not interrupt the user input, by formatting the value before the user has finished typing

Comments

when typing ALT-TAB the component loses its focus and applies the format. I don't see a problem there. the "onChangingDelay=1000" will only affect the delay while typing and not the formatting onChange (after focus lost). How do you expect the value to be updated if not onBlur ??

Thank you Robert. But it is giving major problem for me. Current application is accounting system application, where user will be entering the values as per the statement received from the bank as pdf. So they will open the PDF and my application, use alt tab to navigate between two windows to enter the values.

Comments

it seems difficult to give a simple answer about this: maybe you can describe the exact sequence about when the format should be applied and when not, maybe there is a way to distinguish between the steps and prevent the formatting in certain conditions

You can handle number formatting yourself to format the number as your need (e.g., always keep '.' and display error message if a number ends with '.' while save button clicked), for more information please refer to the related article at my blog: ZK Decimalbox Support Scientific Notation

The character '#' in the format string "####.##" means that the non-significant zero digits would not be displayed. When the focus is lost (e.g. tab to another input widget or switch to another browser tab), decimalbox would think the "entering value phase" has finished, and would apply the format. If the value is "45." at this moment, applying the format would remove the decimal point since the fractional part is zero.

The following is a way to solve the "value entering" interruption issue.

Use a textbox to collect partial input

Have a button to confirm the input

Only after confirmation would the value be copied to the real decimalbox, and the format applied.

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!