Visitar URL original
Number field validation message by robindevitt · Pull Request #1043 · AdvancedCustomFields/acf · GitHub
Skip to content

Number field validation message - #1043

Open
robindevitt wants to merge 1 commit into
AdvancedCustomFields:masterfrom
robindevitt:master
Open

robindevitt wants to merge 1 commit into
AdvancedCustomFields:masterfrom
robindevitt:master

Conversation

@robindevitt

@robindevitt robindevitt commented Oct 7, 2026 •

Copy link
Copy Markdown

Related Issue #1018

%d is a standard integer representation. It renders "1.5" as "1". As the validation message is only shown as a string we could show the value in the string with %s to render it as a string.

I tested using %f as a floating point however the decimal value is longer than what the user will have chose. IE - 1.500000

Using %s seems the best solution to account for what ever value the user could have input into the number field.

Screenshot showing the correct message with the decimal value as the input was setup.
Screenshot 2026-10-07 at 10 47 40

`%d` is a standard integer representation. It renders "1.5" as "1". As the validation message is only shown as a string we could show the value in the string with `%s` to render it as a string.

I tested using `%f` as a floating point however the decimal value is longer than what the user will have chose. IE - 1.500000

Using `%s` seems the best solution to account for what ever value the user could have input into the number field.
@robindevitt
robindevitt requested a review from a team as a code owner October 7, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant