UtilitiesLib
UtilitiesLib
Library for utility functions
This library provides utility functions for common operations.
convertDecimals
function convertDecimals(uint256 value, uint8 fromDecimals, uint8 toDecimals) internal pure returns (uint256 convertedValue)
Converts a value from one decimal precision to another
Parameters
| Name | Type | Description |
|---|---|---|
| value | uint256 | The value to convert |
| fromDecimals | uint8 | The number of decimals in the source value |
| toDecimals | uint8 | The number of decimals to convert to |
Return Values
| Name | Type | Description |
|---|---|---|
| convertedValue | uint256 | The value converted to the target decimals |