This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function decimalString(uint256 number, uint8 decimals, bool isPercent) private pure returns(string memory){ | |
uint8 percentBufferOffset = isPercent ? 1 : 0; | |
uint256 tenPowDecimals = 10 ** decimals; | |
uint256 temp = number; | |
uint8 digits; | |
uint8 numSigfigs; | |
while (temp != 0) { | |
if (numSigfigs > 0) { | |
// count all digits preceding least significant figure |