Numeric Entry Field - Accounting Format

I have numerous numeric entry fields in my project, all of which I have their format set to Accounting $ (0,0.00)

I am wondering if there is a way to change the “default value” of “$0.00” to nothing

This is how I have them configured:
image

If I am in preview mode and I select the numeric entry field, the placeholder then shows “Test”. But until then, the numeric entry field displays “$0.00”. I want this field to not appear anything, unless a user selects it and enters in a value.

I played around with it and found that setting value : null leaves the field empty. (The placeholder is empty.)
One problem with this is that the spinner buttons don’t work as there is no initial value. You could have an event - onFocus, perhaps - set the value to 0 if it is null. Then the spinners should work.

Well the problem is, I can set value : null and it works.

When I start the preview, the field is empty (placeholder is empty). Then when I enter a value in the field, it shows the value. BUT… If I clear that field, it goes back to showing “$0.00” instead of being empty.

You could add a property change script that detects a value of "" (empty string) and replaces it with literal null (None in Python).

… or create an onBlur event and add the script,

	if not self.props.value:
		self.props.value = None

None in Python converts to null on the component property.

1 Like