fact: Definition positive_rational_to_approx_decimal_string (x : Q) : string := let frac_part := (((1000 * Qnum x) / Zpos (Qden x)) mod 1000)%Z in let frac_part_string := if (frac_part =? 0)%Z then "000"%string else if (frac_part <? 10)%Z then append "00" (Z_to_string frac_part) else if (frac_part <? 100)%Z then append "0" (Z_to_string frac_part) else (Z_to_string frac_part) in append (Z_to_string (Qnum x / Z.pos (Qden x))) (append "." frac_part_string).
imports: mathcomp(all_ssreflect) ZArith QArith List String OrderedType OrderedTypeEx FMapAVL