# Pastebin dwJ2NWam method Str { # cut off exponential denorm logic below a modest value my Bool $modest = ( 1/$_ < $!value.abs < $_ ) given $round-cut; with self.error { my ($value, $error, $scale); #| Setting Controlled #| >> $round-val controls rounding explicitly (e.g. 0.01) with $round-val { $scale = $_; $value = $.value-rounded; $error = $!error.absolute.&round($_); } #| Error Controlled #| >> significant digits of error value control rounding $scale //= .scale; if $modest { $value //= $!value.Rat.round($scale); $error //= .absolute.Rat; } else { $value //= $!value.FatRatStr.round($scale); $error //= .denorm; #right shift error value to align digits } return "{ $value }{ $.units } ±{ $error }" } else { # no Error? Setting Controlled! return "{ $.value-rounded }{ $.units }" } }