Re: [libvirt] [PATCH 1/2] util: implement virStrToDoubleSafe().

2017-06-18 Thread Julio Faracco
Great. I sent the V2. Do we have any possibility to create a Locale API (a virLocale API)? Or do you think that it is much work versus few advantages? 2017-06-16 4:03 GMT-03:00 Martin Kletzander : > On Thu, Jun 15, 2017 at 05:51:42PM -0300, Julio Faracco wrote: >> >> Thanks

Re: [libvirt] [PATCH 1/2] util: implement virStrToDoubleSafe().

2017-06-16 Thread Martin Kletzander
On Thu, Jun 15, 2017 at 05:51:42PM -0300, Julio Faracco wrote: Thanks to share the commit SHA, Martin. My only doubt is: I speak Brazilian portuguese (so pt_BR-Latin America and we use comma as separator). Should libvirt consider it as a separator? Or only dot? Because this approach fails to

Re: [libvirt] [PATCH 1/2] util: implement virStrToDoubleSafe().

2017-06-15 Thread Julio Faracco
Thanks to share the commit SHA, Martin. My only doubt is: I speak Brazilian portuguese (so pt_BR-Latin America and we use comma as separator). Should libvirt consider it as a separator? Or only dot? Because this approach fails to parse 12,34 (12.34 US) for example. 2017-06-15 5:27 GMT-03:00

Re: [libvirt] [PATCH 1/2] util: implement virStrToDoubleSafe().

2017-06-15 Thread Martin Kletzander
On Wed, Jun 14, 2017 at 01:24:42PM -0300, Julio Faracco wrote: Following the GNU Documentation, functions to convert double/float to string and vice versa, use the locale to set the mantissa separator. Some languages use comma and other use dot as a separator. For example: 1,212.67 (en_US) =

[libvirt] [PATCH 1/2] util: implement virStrToDoubleSafe().

2017-06-14 Thread Julio Faracco
Following the GNU Documentation, functions to convert double/float to string and vice versa, use the locale to set the mantissa separator. Some languages use comma and other use dot as a separator. For example: 1,212.67 (en_US) = 1.112,67 (pt_BR). This can be used to parse values in float/double