m3m0ry / fixedpoint

Decimal fixed point type
Boost Software License 1.0
6 stars 3 forks source link

Rounding option for string ctor #6

Closed schveiguy closed 3 years ago

schveiguy commented 3 years ago

I'm parsing values from a money column and I want to round to the nearest cent. However, Fixed is going to truncate instead. It would be nice to include a rounding option on the ctor.

schveiguy commented 3 years ago

Thanks, I'm going to submit a PR to fix the allocation.

m3m0ry commented 3 years ago

:facepalm: I completely forgot about negative numbers. Yeah the allocation was also stupid on my part, I stopped thinking about it literally one step before I would arrive at the same solution.

I will have time in November to do some tinkering if necessary. Thank you for your PR :heart:

schveiguy commented 3 years ago

Yeah, I just submitted the issue fully intending to do it myself. But was in the middle of a project and couldn't at the time do it myself.

Thanks!