Add a plus sign in text before the number field and set the text object to "Hive object when:" the value in the field is <0.
Were you reffering to HIDE object when or HIVE object when?
I'm sure it was a typo. The site lags sometimes, and just human error, I proof read my own mistakes and still miss some items, it happens when you read / answer several post.
I would use value < 1 to hide, I consider 0 even and below zero a negative. What works best for you.
Ok, I get it.
But that's not what I want actually...
I want FileMaker to add preffix when I type the number.
Something like this:
I enter "2", FileMaker populates that field with "+2.00"
Only one thing is missing, that plus sign.
format as "currency" and use "+" instead of "$"?
you can show nothing if the field is 0
I guess the question is display or change field? If the value needs to "appear" only, then use the number format.
Nice approach but still not what I'm looking for because I need a field for dioptres. So when type "-2" in the result should be "-2.00" and when I enter "+2" result should be "+2.00"
With your aproach my negative numbers are listed as "+-2.00"
Try using an auto replace calculation, so that when the data is entered it is immediately replaced with the formatted version. Something like:
Let ( [
rawData = Self //this will be whatever is entered by the user
; decimals = ".00" //you might need extra conditions if other than .00 is possible
; formatted = filtered & decimals //this concatenates the above two lines
formatted //this is the result in the field
To use this approach you must make sure you uncheck "Do not replace existing value" for the auto enter option.
thanks, more info provided. I might make a text field with auto-enter and have it as the display, so that the number field can be used for entry. Auto-enter with the desired formatting using build-in functions.
I just made a test database: I created two fields in a table, a number field and a text field. The number field options was set to validate Strict Data Type: Numeric Only. If I type +33 in the field, this is acceptable as a number. This is one way to go, without any handling of the data. I admit that entering + in a number field is not natural, but since optometrist will use the solution, that may do it.
If not, you may attach a script on OnObjectScript for that field that would add a + if the number is positive and a + is not the first character.