Re: [Django] #20601: intcomma and floatformat internationalization error

2019-09-27 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  Ram
 |  Parameswaran
 Type:  New feature  |   Status:  assigned
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  internationalization, humanize,|
  contrib, float, floatcomma |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Claude Paroz):

 * needs_better_patch:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.ea6dab95dc86c7c3b1cc629f799e121d%40djangoproject.com.


Re: [Django] #20601: intcomma and floatformat internationalization error

2019-09-27 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  Ram
 |  Parameswaran
 Type:  New feature  |   Status:  assigned
Component:  Template system  |  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  internationalization, humanize,|
  contrib, float, floatcomma |
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by felixxm):

 * owner:  (none) => Ram Parameswaran
 * status:  new => assigned
 * has_patch:  0 => 1
 * version:  1.10 => master


Comment:

 [https://github.com/django/django/pull/11834 PR]

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.816ddfd2282d7eb76dc0026109ff0e82%40djangoproject.com.


Re: [Django] #20601: intcomma and floatformat internationalization error

2019-08-08 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  (none)
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  internationalization, humanize,|
  contrib, float, floatcomma |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Ron):

 For the specific German case a fix:

 `'|'.join(intcomma(floatformat(amount, 2)).rsplit(',', 1)).replace(',',
 '.').replace('|', ',')`

 Maybe this helps anybody...

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.ac9b73209c9df197d80f98ffcd01abeb%40djangoproject.com.


Re: [Django] #20601: intcomma and floatformat internationalization error

2018-02-28 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  (none)
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  internationalization, humanize,|
  contrib, float, floatcomma |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Alexey):

 Should we try to parse value to float?

 Something like try to find float separator with regex, and convert it
 before `isinstance` check

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.214e18d3a0ccda14c510aab84f48b3de%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #20601: intcomma and floatformat internationalization error

2018-02-28 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  (none)
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  internationalization, humanize,|
  contrib, float, floatcomma |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Alexey):

 * cc: Alexey (added)


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.97c1e1948486533d8aeab0cf6e32664a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #20601: intcomma and floatformat internationalization error

2017-05-13 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  (none)
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  internationalization, humanize,|
  contrib, float, floatcomma |
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Petr Dlouhý):

 * version:  1.5 => 1.10


Comment:

 This is still problem in Django 1.10.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.36ce4c4eb73d29ac03693aa302c51921%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #20601: intcomma and floatformat internationalization error

2013-06-15 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  1.5
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  internationalization, humanize,|  Needs documentation:  0
  contrib, float, floatcomma |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by merb):

 wouldn't it be better to make them type safe? Like raise an error if
 intcomma or floatformat won't get 'numbers' or 'localized_numbers'?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.6fc3e07b4a0a73d3a8ab216880b48580%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #20601: intcomma and floatformat internationalization error

2013-06-15 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:
 Type:  New feature  |   Status:  new
Component:  Template system  |  Version:  1.5
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  internationalization, humanize,|  Needs documentation:  0
  contrib, float, floatcomma |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by claudep):

 * type:  Bug => New feature
 * component:  Python 2 => Template system
 * stage:  Unreviewed => Accepted


Comment:

 Basically, the issue is that both `intcomma` and `floatformat` take
 numbers (or number-convertible values) to output a string representation.
 So chaining them is basically broken. One strategy would be to try harder
 to make those string representation transformed back to numbers, but then
 the first transformation would be lost.

 I'm of the opinion that either one of these filters should be able to do
 all necessary transformations. For example, we could imagine that the
 `floatformat` argument takes an optional `g` suffix to indicate grouping.
 So the result of `Decimal(1000,11)|floatvalue:"2g"` would be 1.000,11 for
 German (i.e. `numberformat` would be passed `force_grouping=True` in
 `floatformat` filter).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.0ecdf660df1a90ed51d04a7b866b987a%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #20601: intcomma and floatformat internationalization error

2013-06-14 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:
 Type:  Bug  |   Status:  new
Component:  Python 2 |  Version:  1.5
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  internationalization, humanize,|  Unreviewed
  contrib, float, floatcomma |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by merb):

 * status:  assigned => new
 * owner:  merb =>


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.c9510340800fd90304a1ee940f124e1e%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #20601: intcomma and floatformat internationalization error

2013-06-14 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  merb
 Type:  Bug  |   Status:  assigned
Component:  Python 2 |  Version:  1.5
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  internationalization, humanize,|  Unreviewed
  contrib, float, floatcomma |  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by merb):

 * type:  Cleanup/optimization => Bug


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.7b31f1dbecc62de1d41089f1e6e810c2%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #20601: intcomma and floatformat internationalization error

2013-06-14 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  merb
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  1.5
Component:  Python 2 |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
  internationalization, humanize,|  Needs documentation:  0
  contrib, float, floatcomma |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by merb):

 This is the actual humanize function:

 {{{
 @register.filter(is_safe=True)
 def intcomma(value, use_l10n=True):
 """
 Converts an integer to a string containing commas every three digits.
 For example, 3000 becomes '3,000' and 45000 becomes '45,000'.
 """
 if settings.USE_L10N and use_l10n:
 try:
 if not isinstance(value, float):
 value = int(value)
 except (TypeError, ValueError):
 return intcomma(value, False)
 else:
 return number_format(value, force_grouping=True)
 orig = force_text(value)
 new = re.sub("^(-?\d+)(\d{3})", '\g<1>,\g<2>', orig)
 if orig == new:
 return new
 else:
 return intcomma(new, use_l10n)
 }}}


 The problem is that floatformat returns a SafeText type, so it isn't a
 instance of float and intcomma gets recalled with use_l10n=False. So this
 line gets called:

 {{{
 new = re.sub("^(-?\d+)(\d{3})", '\g<1>,\g<2>', orig)
 }}}

 This line will add an , to every 3rd place on the SafeText type so a
 string of:
 1000,11 or 100,11 will be
 1,000,11 or 1,000,000,11 which could get converted to an integer, so the
 next time intcomma gets called, it thinks that the SafeText type could now
 get converted to an integer and will then return himself.
 So this will be an uncorrect return value

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.583a9eaf229193cea6d22bd8544107f8%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #20601: intcomma and floatformat internationalization error

2013-06-14 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  merb
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  1.5
Component:  Python 2 |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
  internationalization, humanize,|  Needs documentation:  0
  contrib, float, floatcomma |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by merb):

 Replying to [ticket:20601 c.schmitt@…]:
 > When u use floatvalue "2" and intcomma together in a template the output
 of intcomma won't be internationalized.
 >
 > Since intcomma wont work with decimals in django 1.5.1 i tried to
 convert a decimal to a float in a template, but it wont give me the
 excepted output.
 > When i have the value of 1000.11 it should be 1000,11 in germany, with
 intcomma(float(1000,11)) i get 1.000,11. But when i use
 Decimal(1000,11)|floatvalue"2"|intcomma, i will get 1,000,11. Thats a bug
 or maybe an unwanted behavior.

 i meant floatformat not floatvalue.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.6e839af4ac948e1b8cd0612bce0034d6%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #20601: intcomma and floatformat internationalization error (was: intcomma and floatvalue internationalization error)

2013-06-14 Thread Django
#20601: intcomma and floatformat internationalization error
-+-
 Reporter:  c.schmitt@…  |Owner:  merb
 Type:   |   Status:  assigned
  Cleanup/optimization   |  Version:  1.5
Component:  Python 2 |   Resolution:
 Severity:  Normal   | Triage Stage:
 Keywords:   |  Unreviewed
  internationalization, humanize,|  Needs documentation:  0
  contrib, float, floatcomma |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.6a506ca85159f5976c7ca5830d7b0c06%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.