Skip to content

Commit

Permalink
doc: fix docs related to localization
Browse files Browse the repository at this point in the history
  • Loading branch information
hgrecco committed Jan 22, 2024
1 parent a04a6b5 commit 36e3964
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/getting/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ If Babel_ is installed you can translate unit names to any language
.. doctest::

>>> ureg.formatter.format_quantity(accel, locale='fr_FR')
'1,3 mètre / seconde²'
'1,3 mètre/seconde²'

You can also specify the format locale at the registry level either at creation:

Expand All @@ -446,6 +446,7 @@ and by doing that, string formatting is now localized:

.. doctest::

>>> ureg.default_format = 'P'
>>> accel = 1.3 * ureg.parse_units('meter/second**2')
>>> str(accel)
'1,3 mètre / seconde²'
Expand Down

0 comments on commit 36e3964

Please sign in to comment.