I did quick test with few inscription and it seems to works properly. So here are few of my thought,
1. Is it right to assume your library only have function to look for sat properties of Ordinals inscription based on one of known value (e.g. decimal)?
2. It annoys me
fromDecimal require me to enter string rather than decimal.
> Sat.fromDecimal(313225.1127208201)
<repl>.ts:29:17 - error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
29 Sat.fromDecimal(313225.1127208201)
> Sat.fromDecimal("313225.1127208201")
Sat { n: 1308063627208201 }
3. Function
fromString with parameter
sat initially confuse me. Different name such as
fromSat or
fromSatNumber probably would be better.
Numeric values with decimals are not used when there is no tolerance for error because of the standard way of storing numbers in memory result in values being encoded into a binary fashion. That means a number is represented as a sum of fractions once or zero times from the set { 1, 1/2, 2, 1/4, 4, 1/8, 8, ... }. Most of the time, you can not sum to a given terminating decimal with a finite number of these but you can normally get close enough. This is fine for working with numbers for science where a small error factor is understood and accounted for. We like to be perfectly precise which is why APIs work with sats rather than BTCs. So if you are working with fraction values, as a string, you wont lose information when encoding.