2020-08-18 11:32:48 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2024-11-05 13:52:48 +00:00
|
|
|
package frost.fs.accounting;
|
2020-08-18 11:32:48 +00:00
|
|
|
|
2024-09-05 13:24:35 +00:00
|
|
|
// Standard floating point data type can't be used in FrostFS due to inexactness
|
2020-10-13 09:57:07 +00:00
|
|
|
// of the result when doing lots of small number operations. To solve the lost
|
|
|
|
// precision issue, special `Decimal` format is used for monetary computations.
|
|
|
|
//
|
|
|
|
// Please see [The General Decimal Arithmetic
|
|
|
|
// Specification](http://speleotrove.com/decimal/) for detailed problem
|
|
|
|
// description.
|
2020-08-18 11:32:48 +00:00
|
|
|
message Decimal {
|
2022-04-13 06:21:33 +00:00
|
|
|
// Number in the smallest Token fractions.
|
2024-02-28 15:53:04 +00:00
|
|
|
int64 value = 1 [ json_name = "value" ];
|
2020-08-18 11:32:48 +00:00
|
|
|
|
2020-10-13 09:57:07 +00:00
|
|
|
// Precision value indicating how many smallest fractions can be in one
|
|
|
|
// integer.
|
2024-02-28 15:53:04 +00:00
|
|
|
uint32 precision = 2 [ json_name = "precision" ];
|
2020-10-13 09:57:07 +00:00
|
|
|
}
|