While ticket is creating I've filled down this fields:
Duration unit: Hours
Duration: 0,5

Then I have saved a node and reopen for edit and filed "Duration" was equal to 0.
Only Duration = 0.5 (dot was used give me a right result).
All russian and ukrainian speaking people use comma (,) but not dot (.) for floats.

Can you, please, let using a comma too?

Comments

vladsavitsky’s picture

Ok. The same things should be done for filed "Price".
To do this you should add to function _stormticket_beforesave (in stormticket.module):

  //Allow using comma also:
  $node->duration = str_replace(',', '.', $node->duration);
  $node->price = str_replace(',', '.', $node->price);

I can change all modules and do a patch if it's necessary. Thanks

Magnity’s picture

I'm happy to implement this. If you would be able to provide a patch, it would be most helpful.

A similar issue is at #498116: Internationalization of number formats.

As an extension to this too, there is the issue of displaying these numbers. Ideally a site owner should be able to select a setting that controls whether a , or . is used.

vladsavitsky’s picture

Assigned: Unassigned » vladsavitsky
Status: Active » Patch (to be ported)
StatusFileSize
new3.9 KB

Ok. Here is the patch against 6.x-1.27 for modules where using comma can be useful.

Magnity’s picture

Component: Storm Ticket » Miscellaneous
Status: Patch (to be ported) » Fixed

Thanks - committed.

It will be in the development release within 12 hours, and next stable release as and when.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.