Upon thinking about it, I think the case for `echo num.formatFloat(ffDecimial, 
0)` is incorrect, and should be changed to be consistent with the intent of the 
function.

The `0` option should produce a value (currently it would be `rounded`) with no 
digits displayed.

`echo (10.456).formatFloat(ffDecimal, 0) -> 10`

`echo (10.556).formatFloat(ffDecimal, 0) -> 11`

Also, its current behavior is redundant, as it mimics the behavior of `echo 
num.formatFloat()`. Thus, currently there is no way to use this function to 
display no ('0') digits, which is inconsistent (and undocumented) with what a 
user would expect of its behavior.
    
    
    import strutils
    
    let num = 10.5678
    echo num.formatFloat()
    echo num.formatFloat(ffDecimal, 0)
    

These revelations about how this one little function actually works, have all 
been illuminated because of the effort we've engaged in to document it. How 
much more will be revealed about all the other parts of the language once you 
begin creating `full case tested` documentation?

Reply via email to