Numeric Formatting - I want to limit user input to (6) digits, and display the value as "12345-6".

  • 0
  • 1
  • Question
  • Updated 7 years ago
  • Answered
I'd like to have a numeric field defined to only hold (6) digits (no decimals). But I'd like it displayed as "12345-6" with the hyphen. I didn't see a field masking function, and a formula formatting does not take the current value being entered.
Photo of David W. Brown

David W. Brown

  • 0 Points

Posted 7 years ago

  • 0
  • 1
Photo of David

David

  • 80 Points 75 badge 2x thumb
You won't be able to use a hyphen in a numeric field. You can however create a formula text field and set the max characters to 7 (will include the hyphen) and use a formula based on the number field you have. Here's an example:

If([Number]=0,"",Left(ToText([Number]),5)&"-"&Right(ToText([Number]),1))

You can call this formula text field anything you want but remember its' only a text representation of your number field and you can't do math with text unless you convert it back to numbers (but you already have the original number field).

Hope this helps,
David
Photo of David W. Brown

David W. Brown

  • 0 Points
This looks like it could work, however in a text formula, it will not allow me to enter the current field being entered ([Number])..
Photo of David

David

  • 80 Points 75 badge 2x thumb
I used [Number] to represent your numeric field as I don't know what you call it in your application.