Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a way to force leading zeroes for numbers #714

Open
asheenlevrai opened this issue May 7, 2024 · 1 comment
Open

Implement a way to force leading zeroes for numbers #714

asheenlevrai opened this issue May 7, 2024 · 1 comment

Comments

@asheenlevrai
Copy link

asheenlevrai commented May 7, 2024

Feature Description

Hi :)

My "problem" is described in this thread on DW user forum.

Basically, we need a way to force leading zeroes for numbers (similar to how the Data plugin would support this).

Our users use a Bureaucracy form where they need to input a number in one of the fields. They can enter whatever number from 0 to 999999. However, we need the number to be a 6-digit number. So for now we solved this by using the parameter "000000" in the Bureaucracy form, for the Number field. User input is automatically converted into a 6-digit number by adding leading zeroes.

However, when switching from Data to Struct. This no longer works. The "000000" parameter in the form has no effect.

We used the type "decimal" for the number in the Struct schema (since there isn't a "number" type) [[EDIT: and tweaked it to accept 0 decimals (roundto=0) 20240508: Actually I realized that's not what roundto does. Roundto rounds the value entered by the user to what the parameter defines and displays that in the aggregation table. Here if the user enters 11.6, the number displayed in the table would be 12. but the value for "number" would still be 11.6 /EDIT]].

Any chance to implement this feature? Otherwise could you give me some advice about how to achieve this differently?

Thank you very much :)
-a-

@gregoryloichot
Copy link

That would be solved with #715 right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants