B4J Library NumberFormatInput B4xLib (B4j Only)

This is a B4xlib customview that uses a textfield, label and the textformatter lib to provide formatting of a numeric text field with NumberFormat2.

Once the textfield loses focus, the number is displayed with formatting defined in the custom view by overlaying a label.

Click on the label to edit the text, you can also programmatically get and set the value using the B4xNFinput.text methods.

The customview uses a layout so you can change it as you like if you unpack the lib.


1602792243857.png
1602792269237.png


The number format is modifiable in the designer on the customview but requires delimiting with a semicolon ";" rather than the number formats comma ",".

Depends On:
JavaObject​
Usage:
Download the B4xNFInput b4xlib and TextFormatter B4xlib and save them with your B4xLibs.​
Add the custom view to your layout.​
Define the format in the designer customview entry.​
The demo in the zip file is a simple example.​
Please test and let me know of any problems. Feel free to unpack the library and make any changes you require.​
 

Attachments

  • NFInput.zip
    2 KB · Views: 313
  • B4xNFInput.b4xlib
    3.3 KB · Views: 84
Last edited:
Top