Form Display Field improvement to manage multiple number format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Form Display Field improvement to manage multiple number format

STELTZLEN Charles
Hi,

On display field used in Forms, there is a "type" "accounting-number"
which is used to format number like 'accounting-number.format' property
configuration (arithmetic.properties) :  #,##0.0000;(#,##0.0000).

The proposal is to extend this idea by using a "type" "number" and an
additional attribute called "format-pattern". This field will be used by
form renderer to get the good property. It use FlexibleString to manage
variable in this field and so allow to have different format for the
same column according to some conditions.

example:

   <field name="amount"><display type="number"
format-pattern="accounting"/></field>

The "format-pattern" will be stored in the arithmetic.properties.

example:

   # the default number format
   default.number.format = ##0.00
   accounting.number.format = #,##0.0000;(#,##0.0000)
   quantity.number.format = ##0.00
   integer-quantity.number.format = #0
   percentage.number.format = ##.##%
   export.number.format = #.00

In ModelFormField.java, the system gets property using
EntityUtilProperties.getPropertyValue to be able to quickly add a new
format.

A JIRA exists on this proposition (opened to soon as Jacques mentionned
) :https://issues.apache.org/jira/browse/OFBIZ-7532
Do think that this proposal is a good one ?

Best regards,
Charles


Reply | Threaded
Open this post in threaded view
|

Re: Form Display Field improvement to manage multiple number format

Pierre Smits
Hi Charles,

See my comment in https://issues.apache.org/jira/browse/OFBIZ-7532.

Best regards,

Pierre Smits

ORRTIZ.COM <http://www.orrtiz.com>
OFBiz based solutions & services

OFBiz Extensions Marketplace
http://oem.ofbizci.net/oci-2/

On Mon, Jul 11, 2016 at 3:43 PM, Charles STELTZLEN <
[hidden email]> wrote:

> Hi,
>
> On display field used in Forms, there is a "type" "accounting-number"
> which is used to format number like 'accounting-number.format' property
> configuration (arithmetic.properties) :  #,##0.0000;(#,##0.0000).
>
> The proposal is to extend this idea by using a "type" "number" and an
> additional attribute called "format-pattern". This field will be used by
> form renderer to get the good property. It use FlexibleString to manage
> variable in this field and so allow to have different format for the same
> column according to some conditions.
>
> example:
>
>   <field name="amount"><display type="number"
> format-pattern="accounting"/></field>
>
> The "format-pattern" will be stored in the arithmetic.properties.
>
> example:
>
>   # the default number format
>   default.number.format = ##0.00
>   accounting.number.format = #,##0.0000;(#,##0.0000)
>   quantity.number.format = ##0.00
>   integer-quantity.number.format = #0
>   percentage.number.format = ##.##%
>   export.number.format = #.00
>
> In ModelFormField.java, the system gets property using
> EntityUtilProperties.getPropertyValue to be able to quickly add a new
> format.
>
> A JIRA exists on this proposition (opened to soon as Jacques mentionned ) :
> https://issues.apache.org/jira/browse/OFBIZ-7532
> Do think that this proposal is a good one ?
>
> Best regards,
> Charles
>
>
>