Hi, I'm preparing a method to write a given Pharo's numerical value into an external variant of type VT_DECIMAL. The purpose of this type is to retain accuracy, it uses 12 bytes for "mantissa" and two bytes for a sign and a scale (i. e. the position of decimal point). What would be the best approach for the conversion, taken all the possible subclasses of class Number, that is a Float, a Fraction and the Integers, and to keep the accuracy at the same level?
For instance, Fraction's numerator and denominator could be directly imputed into VT_DECIMAL's value and scale if denominator is a power of 10. What to do in other cases? A nice description of VT_DECIMAL is here <https://bytecomb.com/vba-internals-decimal-variables-and-pointers-in-depth/> . Best wishes, Tomaz -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html