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

Allow input and display of floats for Number fields #6987

Closed
Tracked by #6445
ijreilly opened this issue Sep 11, 2024 · 4 comments · Fixed by #7340
Closed
Tracked by #6445

Allow input and display of floats for Number fields #6987

ijreilly opened this issue Sep 11, 2024 · 4 comments · Fixed by #7340
Assignees
Labels

Comments

@ijreilly
Copy link
Collaborator

Scope & Context

We only allow to persist and display integers for fields of type Number while there is demand for persisting/displaying floats + all our number fields data is stored in a column that accepts floats.

Expected behavior

We always persist the input value if it's a number, but we display the value according to the decimal settings.
So for example let's say we have set the number of decimal to 0, but the input the value is 2.6.
We persist 2.6 and display 3.

Technical inputs

The vision is to introduce a setting on fieldType of type 'NUMBER'.
NumberFieldTypeSetting {
decimals: number
}
This settings is settable in the product. Here is the design:
image

This settings should be leveraged in the FE to display the value correctly.
In case it can be of any help - a first PR was opened on this topic but the issue can be taken over from scratch.

Copy link
Contributor

gitstart-app bot commented Sep 11, 2024

Here is the GitStart Ticket for this issue: https://clients.gitstart.com/twenty/5449/tickets/TWNTY-6987

@gitstart-twenty
Copy link
Contributor

Hello @Bonapara 👋
could you send the Figma design for the option section?
image

@Bonapara
Copy link
Member

Sure! https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=34845-127971&node-type=frame&t=IXWRE0LasgigcLyR-11

@gitstart-twenty
Copy link
Contributor

Thank you @Bonapara
could you give us access to the dev mode on Figma? I sent this message with more details on discord: https://discord.com/channels/1130383047699738754/1163747555461570650/1283749603157610536

ijreilly added a commit that referenced this issue Oct 4, 2024
### Description

- We added a decimal field for a Number Field type in the settings
- We updated the Number Field type create a form with decimals input
- We are not implementing the dropdown present on the Figma because it
seems not related

### Demo


<https://www.loom.com/share/18a8d4b712a14f6d8b66806764f8467f?sid=3fc79b46-ae32-46e3-8635-d0eee02e53b2>

Fixes #6987

---------

Co-authored-by: gitstart-twenty <[email protected]>
Co-authored-by: Marie Stoppa <[email protected]>
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in 🎯 Roadmap & Sprints Oct 4, 2024
harshit078 pushed a commit to harshit078/twenty that referenced this issue Oct 14, 2024
### Description

- We added a decimal field for a Number Field type in the settings
- We updated the Number Field type create a form with decimals input
- We are not implementing the dropdown present on the Figma because it
seems not related

### Demo


<https://www.loom.com/share/18a8d4b712a14f6d8b66806764f8467f?sid=3fc79b46-ae32-46e3-8635-d0eee02e53b2>

Fixes twentyhq#6987

---------

Co-authored-by: gitstart-twenty <[email protected]>
Co-authored-by: Marie Stoppa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants