diff options
| author | Hernan Grecco <hernan.grecco@gmail.com> | 2017-04-16 00:48:12 -0300 |
|---|---|---|
| committer | Hernan Grecco <hernan.grecco@gmail.com> | 2017-04-16 00:48:12 -0300 |
| commit | 8a016bbd5f3b18a5ae79a56bcca69be56a0ac2a9 (patch) | |
| tree | c388310fbb2827209761d7519d9369c14f41ce4a /docs/tutorial.rst | |
| parent | 979e5cc65e3110969cc81b80c49777fcdc45fb2c (diff) | |
| download | pint-8a016bbd5f3b18a5ae79a56bcca69be56a0ac2a9.tar.gz | |
Improved docs
Diffstat (limited to 'docs/tutorial.rst')
| -rw-r--r-- | docs/tutorial.rst | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/tutorial.rst b/docs/tutorial.rst index f3f82a5..f26f512 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -287,7 +287,7 @@ Pint also supports the LaTeX siunitx package: >>> print('The siunitx representation is {:Lx}'.format(accel)) The siunitx representation is \SI[]{1.3}{\meter\per\second\squared} -Finally, you can specify a default format specification: +Additionally, you can specify a default format specification: .. doctest:: @@ -298,6 +298,14 @@ Finally, you can specify a default format specification: 'The acceleration is 1.3 meter/second²' +Finally, if Babel_ is installed you can translate unit names to any language + +.. doctest:: + + >>> accel.format_babel(locale='fr_FR') + '1.3 mètre par seconde²' + + Using Pint in your projects --------------------------- @@ -342,3 +350,4 @@ also define the registry as the application registry:: .. _eval: http://docs.python.org/3/library/functions.html#eval .. _`serious security problems`: http://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html +.. _`Babel`: http://babel.pocoo.org/ |
