• DECIMAL SEPARATOR FOR NUMERIC PROPERTIES

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #23106  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
 #23120  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 ).
 #26154  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.
Last edited by ptyll on Mon Nov 04, 2013 7:54 am, edited 1 time in total.
 #26155  by jllort
 
I suggest take a look again, because in spanish the property by default general.decimal.pattern is a coma
 #26156  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.
 #26157  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.)
 #26164  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.
 #26180  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 \.
 #26183  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?
 #26185  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 ).

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.