Skip to main content

Formatting numbers

1 reply [Last post]
jmazurek
Offline
Joined: 2004-09-15
Points: 0

Hi all,

is there in JDNC components (JNTable/JNForm) any kind of support for formatting numbers (decimal numbers, currency symbol and position)?

In the best case I mean e.g. way by setting mask in
metadata. However, I was not able to find any suitable approach.

Have I missed something?

And if there was nothing suitable, could you in at least few words (or lines, preferably :-)) show me the best way?

Thank you
Mirek

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Amy Fowler

jdnc-interest@javadesktop.org wrote:

> Hi all,
>
> is there in JDNC components (JNTable/JNForm) any kind of support for formatting numbers (decimal numbers, currency symbol and position)?
>
> In the best case I mean e.g. way by setting mask in
> metadata. However, I was not able to find any suitable approach.

MetaData does provide the "encodeFormat" property, which in theory is
a slot for holding an appropriate format object when converting object
values to strings (as is common for the UI display case). The type of
this object is obviously dependent on the specific Converter implementation,
which is a looser api than I'd like, but I can't see how to get around it.
The converter implementations (see org.jdesktop.swing.data.Converters)
should document what sort of format object they expect, if any.

The bad news is that right now the table renderers don't awknowledge the
MetaData when making display choices, which I consider a bug.
Ditto for the form.

I'd really appreciate it if you could file a bug on this:

https://jdnc.dev.java.net/servlets/ProjectIssues

thanks!
Aim

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net