Doubt about format in number fields

Questions and answers for designing and implementing forms in Servoy

Doubt about format in number fields

Postby pentamsi » Fri Jun 07, 2013 11:18 am

I have a issue with the format number of the fields.

For example y want to put the group separator every 3 number, as usual, but when i edit i don't want to put the separator, and after for example want to delimitate the amount of number to 5. But when I try to put this configuration
Image

and use in the form I have the problem when i put all the number in the field, count the separators as character and don't display all the number:

When editing the number
Image

When not editing
Image

Any one know any solution or this is a bug?
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Doubt about format in number fields

Postby david » Sat Jun 08, 2013 7:36 am

Set the display format to at least "##,###". Need a format character for every possible position.

Side note: going beyond formatters there are UI converters which allow you to do some pretty funky things with display vs storage. Entering fractions and storing as decimal for example: https://www.servoyforge.net/projects/fractions
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Doubt about format in number fields

Postby pentamsi » Mon Jun 10, 2013 1:54 pm

No, it doesn't work changin the display format, still see 4 number and 1 delimeter.
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Doubt about format in number fields

Postby david » Mon Jun 10, 2013 7:47 pm

I don't think you are having a formatting issue as this does work. How many digits in front of the fractional component does your backend numeric type allow for?
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Doubt about format in number fields

Postby pentamsi » Tue Jun 11, 2013 9:27 am

The delimiter is for the number separator, not decimal separator.
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Doubt about format in number fields

Postby david » Tue Jun 11, 2013 9:43 am

What is the backend storage type of the column?
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: Doubt about format in number fields

Postby pentamsi » Tue Jun 11, 2013 10:28 am

It's a NUMBER type in the dbi
Image
User avatar
pentamsi
 
Posts: 335
Joined: Thu Nov 03, 2011 2:20 pm
Location: Barcelona, Spain

Re: Doubt about format in number fields

Postby david » Tue Jun 11, 2013 5:52 pm

The dbi file only lists the most generic column type information. For example, a MySQL decimal(4,2) type is a number field to Servoy but it will only store two digits to the right and left of the decimal point.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.


Return to Forms

Who is online

Users browsing this forum: No registered users and 20 guests

cron