to_precision 0.1.2

Write out a float rounded to the given position.
Documentation

A function that works like javascript's toPrecision.

Internally it rounds and then uses the built-in algorithm, so it will give different results to toPrecision. They may converge over time.