sys/turo: Add decimal integer printer
Contribution description
As a way around using floats and to prevent code bloat a turo_s32_frac is added to the turo API.
The functionality is based on the fmt_s32_dfp from the fmt.h library, however, since a fixed length print buffer is needed we add some constraints to the overall functionality. This will only be allowed to insert a decimal within an existing int32, not be able to multiply by 10s or be able to divide more that TENMAP (8) 10s.
Testing procedure
Murdock green (unittests and tests/turo)
Issues/PRs references
Can be used by #17029 Depends on #17072
Though the tests/turo addition does a good job at confirming the json parsability I would like to add it to unittests (just to make sure no more spurious asserts) but I would like #17037 in first...
This needs a rebase @MrKevinWeiss!
Needs a bit more of a rebase, it needs some rework and also implementation of the fmt print_s32_frac_dec
@MrKevinWeiss, any estimate whether you will have the time to work on it for the upcoming release?
yup, maybe end of the week.
Though I don't know if @kaspar030 still wants it...
Well a bit of a rework. Since there can be a pretty large amount of digits to print I needed some flushable way of dumping leading and trailing 0s. The brought be down something of a rabbit hole.
I will need to clean this up (ran out of time today) but I don't know if this is desirable or if we just want to use some sort of 1.234e-10 type of notation instead (at least we can know our bounds.
Since this is based on the s32_dfp function from @kaspar030 (I think it still is nice to have some scaling function that doesn't use floats), maybe he can give some feedback on the approach (not the code as this will be cleaned later).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.
I don't think this is needed anymore