Closed ppoliani closed 1 year ago
Hey @ppoliani, this is normal behaviour, we just added more precision to your value. However, it is a good point that you bring up, maybe we should add more precision and only return the value set by the user.
Would it be possible to choose the precision we want? To be honest these figures are. quite big and we store those values in a database so there is quite a bit of extra space needed.
I am actually just gonna remove the with_prec(100)
when returning back the data from the store. The precision will be set by you when you create the BigDecimal
.
This seems to be fixed here https://github.com/streamingfast/substreams-rs/commit/1c237f8f99fd59169cc16ab107619cbd81a5638a. I have manually tested is as well. Thanks @Eduard-Voiculescu
I'm using the
StoreMinBigDecimal
to keep the min value in a store like so:The above log prints
BigDecimal(1000000)
However, when I lated read the value from the store I get a different value.
The logs now show a very long value
BigDecimal(1000000.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
Is this the expected behaviour?