-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add information about precision on format_percent #460
Conversation
Current coverage is 90.15% (diff: 100%)@@ master #460 diff @@
==========================================
Files 24 24
Lines 3979 3983 +4
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 3587 3591 +4
Misses 392 392
Partials 0 0
|
@@ -346,21 +346,45 @@ def format_percent(number, format=None, locale=LC_NUMERIC): | |||
u'2,512%' | |||
>>> format_percent(25.1234, locale='sv_SE') | |||
u'2\\xa0512\\xa0%' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line contains following spacing inconsistencies:
- Trailing whitespaces.
SpaceConsistencyBear, severity NORMAL, section default
.
The issue can be fixed by applying the following patch:
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -346,7 +346,7 @@
u'2,512%'
>>> format_percent(25.1234, locale='sv_SE')
u'2\\xa0512\\xa0%'
-
+
You can set the percent precision changing the scale
>>> format_percent(0.345, locale='en_US', scale=2)
u'34.50%'
@@ -346,21 +346,45 @@ def format_percent(number, format=None, locale=LC_NUMERIC): | |||
u'2,512%' | |||
>>> format_percent(25.1234, locale='sv_SE') | |||
u'2\\xa0512\\xa0%' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line contains following spacing inconsistencies:
- Trailing whitespaces.
SpaceConsistencyBear, severity NORMAL, section default
.
The issue can be fixed by applying the following patch:
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -346,7 +346,7 @@
u'2,512%'
>>> format_percent(25.1234, locale='sv_SE')
u'2\\xa0512\\xa0%'
-
+
You can set the percent precision changing the scale
>>> format_percent(0.345, locale='en_US', scale=2)
u'34.50%'
@@ -346,21 +346,45 @@ def format_percent(number, format=None, locale=LC_NUMERIC): | |||
u'2,512%' | |||
>>> format_percent(25.1234, locale='sv_SE') | |||
u'2\\xa0512\\xa0%' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line contains following spacing inconsistencies:
- Trailing whitespaces.
SpaceConsistencyBear, severity NORMAL, section default
.
The issue can be fixed by applying the following patch:
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -346,7 +346,7 @@
u'2,512%'
>>> format_percent(25.1234, locale='sv_SE')
u'2\\xa0512\\xa0%'
-
+
You can set the percent precision changing the scale
>>> format_percent(0.345, locale='en_US', scale=2)
u'34.50%'
@@ -346,21 +346,45 @@ def format_percent(number, format=None, locale=LC_NUMERIC): | |||
u'2,512%' | |||
>>> format_percent(25.1234, locale='sv_SE') | |||
u'2\\xa0512\\xa0%' | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line contains following spacing inconsistencies:
- Trailing whitespaces.
SpaceConsistencyBear, severity NORMAL, section default
.
The issue can be fixed by applying the following patch:
--- a/babel/numbers.py
+++ b/babel/numbers.py
@@ -346,7 +346,7 @@
u'2,512%'
>>> format_percent(25.1234, locale='sv_SE')
u'2\\xa0512\\xa0%'
-
+
You can set the percent precision changing the scale
>>> format_percent(0.345, locale='en_US', scale=2)
u'34.50%'
This is conflicted by #494, so closing. |
I've written more information about precision on format_percent.