quagmt / udecimal

A high-performance, high precision, zero allocation fixed-point decimal library for financial applications
https://quagmt.github.io/udecimal/
BSD 3-Clause "New" or "Revised" License
111 stars 4 forks source link

feat: add support for text-based encoding #9

Closed mdawar closed 1 month ago

mdawar commented 1 month ago

Hey,

Currently the Decimal type does not support text-based encoding, for example YAML encoding will produce {} instead of a string representation of the decimal value.

This pull request implements the encoding.TextMarshaler and encoding.TextUnmarshaler interfaces which are recognized by many text-based encoding packages and libraries.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.53%. Comparing base (9f1afce) to head (5eb136f). Report is 7 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #9 +/- ## ========================================== + Coverage 94.51% 94.53% +0.02% ========================================== Files 5 5 Lines 1257 1263 +6 ========================================== + Hits 1188 1194 +6 Misses 37 37 Partials 32 32 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.