Input format for numbers

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Input format for numbers

Baschir Jaghoori
Hi,

Does anyone know how to make Orbeon accept numbers with "," as separator
in input fields? I mean 1,99 instead of 1.99?

In other words: I want to enter 1,99 in my input field and have Orbeon
store 1.99 in my XML instance.

thanks
Baschir


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Input format for numbers

Alessandro  Vernet
Administrator
Baschir,

On Wed, Nov 4, 2009 at 6:50 AM, Baschir Jaghoori
<[hidden email]> wrote:
> Does anyone know how to make Orbeon accept numbers with "," as separator in
> input fields? I mean 1,99 instead of 1.99?

You can't do this right now. We have a currency component (see link to
do below), which supports some configuration parameters (currency
prefix and number of digits after the digit separator), but in
addition to that it would be good to allow you to configure it with
the digit separator you want (comma instead of period).

http://wiki.orbeon.com/forms/doc/developer-guide/xbl-existing-xbl-components#TOC-Currency

You will find the code for that component under:

http://github.com/orbeon/orbeon-forms/tree/master/src/resources-packaged/xbl/orbeon/currency/

If you want to improve the currency component to support a "digit
separator" property, you can override those files by placing your own
version of those files under your resources/xbl/orbeon/currency.

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Input format for numbers

Baschir Jaghoori
Thanks! I tried it and it works perfectly. What would be really nice is
if I could set parameters "decimalSeparator" and "thousandsSeparator" in
properties-local.xml and pass that parameters to currency.js!

btw, YUI seems to support number formatting - maybe we could use that?

http://developer.yahoo.com/yui/3/examples/datatype/datatype_numberformat.html

Baschir

Alessandro Vernet schrieb:

> Baschir,
>
> On Wed, Nov 4, 2009 at 6:50 AM, Baschir Jaghoori
> <[hidden email]> wrote:
>> Does anyone know how to make Orbeon accept numbers with "," as separator in
>> input fields? I mean 1,99 instead of 1.99?
>
> You can't do this right now. We have a currency component (see link to
> do below), which supports some configuration parameters (currency
> prefix and number of digits after the digit separator), but in
> addition to that it would be good to allow you to configure it with
> the digit separator you want (comma instead of period).
>
> http://wiki.orbeon.com/forms/doc/developer-guide/xbl-existing-xbl-components#TOC-Currency
>
> You will find the code for that component under:
>
> http://github.com/orbeon/orbeon-forms/tree/master/src/resources-packaged/xbl/orbeon/currency/
>
> If you want to improve the currency component to support a "digit
> separator" property, you can override those files by placing your own
> version of those files under your resources/xbl/orbeon/currency.
>
> Alex
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Input format for numbers

Alessandro  Vernet
Administrator
Baschir,

On Thu, Nov 5, 2009 at 8:39 AM, Baschir Jaghoori
<[hidden email]> wrote:
> Thanks! I tried it and it works perfectly. What would be really nice is if I
> could set parameters "decimalSeparator" and "thousandsSeparator" in
> properties-local.xml and pass that parameters to currency.js!
>
> btw, YUI seems to support number formatting - maybe we could use that?
>
> http://developer.yahoo.com/yui/3/examples/datatype/datatype_numberformat.html

Cool, I didn't know about YUI's DataType. Yes, definitely, that will
make it easier. Now, one snag is that YUI only has this in YUI 3, and
we're using YUI 2. Since YUI 3 is final now, we should migrate to it,
but that will be a more involved than the usual YUI migration since
APIs changes significantly between YUI 2 and 3.

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Input format for numbers / currency

Baschir Jaghoori
Hi all,

I've attached my changes to currency.js to use "," instead of "." as
decimal separator (hard-coded). I did not manage to change the thousands
separator from "," to "." and removed it.

It would also be nice, if the separator character could be read from
properties-local.xml, but I still don't know how to do that...

Baschir

Alessandro Vernet schrieb:

> Baschir,
>
> On Thu, Nov 5, 2009 at 8:39 AM, Baschir Jaghoori
> <[hidden email]> wrote:
>> Thanks! I tried it and it works perfectly. What would be really nice is if I
>> could set parameters "decimalSeparator" and "thousandsSeparator" in
>> properties-local.xml and pass that parameters to currency.js!
>>
>> btw, YUI seems to support number formatting - maybe we could use that?
>>
>> http://developer.yahoo.com/yui/3/examples/datatype/datatype_numberformat.html
>
> Cool, I didn't know about YUI's DataType. Yes, definitely, that will
> make it easier. Now, one snag is that YUI only has this in YUI 3, and
> we're using YUI 2. Since YUI 3 is final now, we should migrate to it,
> but that will be a more involved than the usual YUI migration since
> APIs changes significantly between YUI 2 and 3.
>
> Alex
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws

currency.js (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Input format for numbers / currency

Alessandro  Vernet
Administrator
Baschir,

On Mon, Nov 9, 2009 at 8:01 AM, Baschir Jaghoori
<[hidden email]> wrote:
> I've attached my changes to currency.js to use "," instead of "." as decimal separator (hard-coded). I did not manage to change the thousands separator from "," to "." and removed it.

Thank you for sharing this with us. We can't use the change as is in
Orbeon Forms (as you said, we would need to have a configuration
parameter for this), but this can be useful if someone else needs to
use the coma instead of the period in their application, and just
needs that.

Alex
--
Orbeon Forms - Web forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet