Skip to content

Commit

Permalink
re-add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dianakocsis committed Oct 7, 2024
1 parent f72f195 commit c10da46
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/libraries/Descriptor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,16 @@ library Descriptor {
} else {
// represents fee less than 1%
// else if decimal < 1
nZeros = 5 - digits;
params.zerosStartIndex = 2;
params.zerosEndIndex = uint8(nZeros + params.zerosStartIndex - 1);
params.bufferLength = uint8(nZeros + numSigfigs + 2);
params.sigfigIndex = uint8(params.bufferLength - 2);
nZeros = 5 - digits; // number of zeros, inlcuding the zero before decimal
params.zerosStartIndex = 2; // leading zeros will start after the decimal point
params.zerosEndIndex = uint8(nZeros + params.zerosStartIndex - 1); // end index for leading zeros
params.bufferLength = uint8(nZeros + numSigfigs + 2); // total length of string buffer, including "0." and "%"
params.sigfigIndex = uint8(params.bufferLength - 2); // index of starting signficant figure
params.isLessThanOne = true;
}
params.sigfigs = uint256(fee) / (10 ** (digits - numSigfigs));
params.sigfigs = uint256(fee) / (10 ** (digits - numSigfigs)); // the signficant figures of the fee
params.isPercent = true;
params.decimalIndex = digits > 4 ? uint8(digits - 4) : 0;
params.decimalIndex = digits > 4 ? uint8(digits - 4) : 0; // based on total number of digits in the fee
return generateDecimalString(params);
}
Expand Down

0 comments on commit c10da46

Please sign in to comment.