summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHernan Grecco <hernan.grecco@gmail.com>2013-12-17 16:20:56 -0300
committerHernan Grecco <hernan.grecco@gmail.com>2013-12-17 16:20:56 -0300
commit683f04c2d9e4879442b8882d240f689ca63a0f35 (patch)
tree7a16e5ae928ba632b4936f69fabeabdc4b658cf4
parent4fcf682a7273c2d0f1499320ca71b4ddc9222811 (diff)
downloadpint-683f04c2d9e4879442b8882d240f689ca63a0f35.tar.gz
Added docs for default_format
-rw-r--r--docs/tutorial.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index 5d5f067..dff8949 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -190,6 +190,14 @@ If you want to use abbreviated unit names, suffix the specification with `~`:
The same is true for latex (`L`), pretty (`P`) and HTML (`H`) specs.
+Finally, you can specify a default format specification:
+
+ >>> 'The acceleration is {}'.format(accel)
+ 'The acceleration is 1.3 meter / second ** 2'
+ >>> ureg.default_format = 'P'
+ >>> 'The acceleration is {}'.format(accel)
+ 'The acceleration is 1.3 meter/secondĀ²'
+
Using Pint in your projects
---------------------------