Consider: Utility function for determining number of significant digits to display for Oracle
Currently we use the following approach on other code:
export const oracleScalingFactorToDecimalPlaces = function(oracleScalingFactor: number): number
{
const decimalPlaces = (oracleScalingFactor.toString().length - 1);
return decimalPlaces;
};
However:
Maybe pedantic... but I don't think attestation scaling is limited to powers of ten by the spec. So this could result in incorrect values, if that actually affects data somewhere.
@monsterbitar can you confirm?
I previously suggested that if we want it to be powers of ten, then the scaling should be stored as the power of ten instead of an arbitrary number.
Also... powers of ten don't have to be integers, so this still wouldn't work 😅
- JN
We might want to see if we can come up with a better approach for this.