Page 1 of 1

DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Sat May 18, 2013 6:49 pm
by rachoski
I have created a custom property group with a field intended to contain numeric values (with decimal like euro amounts).

After register and restarted application, I failed to add values on this custom group because of this decimal value.
The error message is "Decimal field required - (000.00) "

Tested with comma and point as decimal separators.

Reproduced on the demo site using properties group (Digitalización certificada) with users in Spanish and English language.

Can be this values be configured to be right justified when adding values.. (they are left justified as text).

Kind regards
Jose Menendez

My custom properties group file
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.0//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.0.dtd">
<property-groups>

  <property-group label="Registro Facturas" name="okg:invoices">
    <input label="Proveedor" type="text" name="okp:invoices.supplier" />
    <input label="Factura Nº" type="text" name="okp:invoices.number" />
    <input label="Factura Fecha" type="date" name="okp:invoices.date" />
     <input label="Factura Importe" type="text" name="okp:invoices.amount" >
    	<validator type="dec"/>
    </input>
  </property-group>    
    
</property-groups>

My Installation:
Windows 7 (64 bits) - español
OpenKM 6.2.4 (build 8074)
MySQL (5.5.27)
Chrome Versión 26.0.1410.64 m

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Mon May 20, 2013 10:20 am
by jllort
In language you got general.decimal.pattern, you should change by your desired decimal. ( That could have problem for other languages installed in your system, you should set for all the wished decimal.pattern ).

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Mon May 20, 2013 5:00 pm
by rachoski
Thanks, fixed....

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Mon Nov 04, 2013 5:37 am
by ptyll
How did you fix it? I have "." in both english and spanish translations, and still my fresh shiny OpenKM installation complains about Decimal field required, even though I'm entering 123.45 :(

Checked in Chrome, same error. I'm using Firefox 25.0. After checking the code, the dot in (000.00) comes from langauge pack, so there's definitely some bug in OpenKM here.

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Mon Nov 04, 2013 7:52 am
by jllort
I suggest take a look again, because in spanish the property by default general.decimal.pattern is a coma

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Mon Nov 04, 2013 7:55 am
by ptyll
(I edited my post just as you were responding)

Yes, I've changed that to a dot just to be sure. Nonetheless, both comma and dot do not work.

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Mon Nov 04, 2013 8:17 am
by ptyll
More details coming: I tested setting to 'u' and ','. Both stupid test of 'u' and comma WORKED, so there's some problem only with dot - at last, progress :)
(both comma and dot in my previous post referred to both comma and dot not working, while decimal character was set to dot.)

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Tue Nov 05, 2013 6:57 pm
by jllort
Problem is solved or not ? it's not clear to me.

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Tue Nov 05, 2013 8:24 pm
by ptyll
No, problem is not solved. Problem only occurs with dot as decimal separator. If changed to 'u' or ',', ie. 123u45 or 123,45 everything works as expected. However when set to dot, ie. 123.45, OpenKM complains about bad formatting.

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Sat Nov 09, 2013 5:02 pm
by jllort
Could be a problem with dot in pattern could you try with \. because if I'm not wrong dot is reserved character into pattern and really dot as itself is \.

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Sun Nov 10, 2013 5:13 am
by ptyll
It did work with '\.', thanks :)
However, there's a problem now when wrong value is entered: Decimal field required - (000\.00) :)
I can live with that I suppose, but maybe it would be worthwhile to fix this in next release?

Re: DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

PostPosted:Sun Nov 10, 2013 11:16 am
by jllort
Quite difficult problem to be solved because pattern must include \ but if it's shown directly to end user will cause some confusion. I will think about it. One solution could be replace "\2 to "" when pattern is shown ( it's trivial change in source code but can generate other kind of problem when because we're lying end user, I must think about it ).