use %.16g for `$` float

This solves the trailing zero problem, but the ultimate solution would be to port ruby/python.