-
-
Notifications
You must be signed in to change notification settings - Fork 10
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 weight field to take decimals #4
Labels
enhancement
New feature or request
Comments
should have maybe added that I'm in the UK and measuring weights in KG |
Would like this too please! Rounding up/down to the nearest whole number makes the graph fluctuate weirdly, even in freedom lbs. |
Judge40
added a commit
to Judge40/ExerciseDiary
that referenced
this issue
Oct 19, 2024
Use the `shopspring/decimal` library to add support for decimal weight values. - Change each `Weight` field's type to `decimal.Decimal` - Replace `strconv.Atio()` with `decimal.NewFromString()` for Weight - Modify SQL statements to insert the decimal value - Update weight inputs to allow decimal places and a min value of zero - Set chart weight axis precision to zero so charts are not changed for users not using decimals This approach works without modifying the column type due to SQLite's type affinity. Ideally the column type would be changed to a more suitable type to better support other DBs, like PostgreSQL, in the future. However, that would require decisions to be made around migration processes, which may be better deferred until that work is undertaken. Resolves aceberg#4
Judge40
added a commit
to Judge40/ExerciseDiary
that referenced
this issue
Oct 19, 2024
Use the `shopspring/decimal` library to add support for decimal weight values. - Change each `Weight` field's type to `decimal.Decimal` - Replace `strconv.Atio()` with `decimal.NewFromString()` for Weight - Modify SQL statements to insert the decimal value - Update weight inputs to allow decimal places and a min value of zero - Set chart weight axis precision to zero so charts are not changed for users not using decimals This approach works without modifying the column type due to SQLite's type affinity. Ideally the column type would be changed to a more suitable type to better support other DBs, like PostgreSQL, in the future. However, that would require decisions to be made around migration processes, which may be better deferred until that work is undertaken. Resolves aceberg#4
Judge40
added a commit
to Judge40/ExerciseDiary
that referenced
this issue
Oct 19, 2024
Use the `shopspring/decimal` library to add support for decimal weight values. - Change each `Weight` field's type to `decimal.Decimal` - Replace `strconv.Atio()` with `decimal.NewFromString()` for Weight - Modify SQL statements to insert the decimal value - Update weight inputs to allow decimal places and a min value of zero - Set chart weight axis precision to zero so charts are not changed for users not using decimals This approach works without modifying the column type due to SQLite's type affinity. Ideally the column type would be changed to a more suitable type to better support other DBs, like PostgreSQL, in the future. However, that would require decisions to be made around migration processes, which may be better deferred until that work is undertaken. Resolves aceberg#4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Weight field does not currently allow decimals and seems to expect a whole number
Change 'weight' field from int to single/double etc
Trying to enter 102.5 for example fails
The text was updated successfully, but these errors were encountered: