OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

ooBase numeric field leading zero issue

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
maurice.pinner
Newbie
Newbie


Joined: 05 Oct 2010
Posts: 2

PostPosted: Tue Oct 05, 2010 1:39 am    Post subject: ooBase numeric field leading zero issue Reply with quote

How can I stop numerical fields from suppressing leading zeros.
_________________
Maurice
Back to top
View user's profile Send private message Send e-mail
keme
Moderator
Moderator


Joined: 30 Aug 2004
Posts: 2732
Location: Egersund, Norway

PostPosted: Tue Oct 05, 2010 2:46 am    Post subject: Reply with quote

You can't. "Numerical" means "only preserve the value of the number", iow. "leading zeroes are of no interest".

You can set the field format to display a minimum number of digits. Then shorter numbers will have zeroes prepended. To preserve the digits exactly as typed, including leading zeroes, you need a text field.
Back to top
View user's profile Send private message
maurice.pinner
Newbie
Newbie


Joined: 05 Oct 2010
Posts: 2

PostPosted: Tue Oct 05, 2010 3:41 am    Post subject: Reply with quote

Quote:
You can't. "Numerical" means "only preserve the value of the number", iow. "leading zeroes are of no interest".

Thanks for prompt reply. I come from a Filemaker Pro background where a number type field holds leading zeros.

_________________
Maurice
Back to top
View user's profile Send private message Send e-mail
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Tue Oct 05, 2010 7:55 am    Post subject: Reply with quote

maurice.pinner wrote:
Quote:
You can't. "Numerical" means "only preserve the value of the number", iow. "leading zeroes are of no interest".

Thanks for prompt reply. I come from a Filemaker Pro background where a number type field holds leading zeros.

The filemaker database will certainly not save any leading zeros for numeric field types.
You can apply some number format to fill up some amount of digits with leading zeroes..
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
Back to top
View user's profile Send private message
keme
Moderator
Moderator


Joined: 30 Aug 2004
Posts: 2732
Location: Egersund, Norway

PostPosted: Wed Oct 06, 2010 1:24 am    Post subject: Reply with quote

With some database types there is the "numeric string", which is a text type that allows only digits and (in some cases) a few punctuation characters. Haven't used that for a long time, but it may be an option in Filemaker.
Back to top
View user's profile Send private message
MSPhobe
Super User
Super User


Joined: 29 Sep 2005
Posts: 529
Location: England

PostPosted: Mon Oct 25, 2010 4:41 am    Post subject: Reply with quote

If you are determined to have NUMERIC data "inside" the database, but leading zeros on your screen, I suppose there must be a way to have the form convert the numeric to a string, and prepend one or more zeros.

It wouldn't really "answer" the question asked, as it would either...

a) Add one leading zero

... or ...

b) Always pad the number out to a fixed number of digits, e.g....

001
010
100
999

..... but I thought I'd mention the possibility.

====

Another approach would be to store the "numbers" as text, and convert that to actual numbers when actual numbers were needed.


====
Each approach probably has a legitimate use in some context. Ah, the joys of database design!
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10065
Location: Germany

PostPosted: Mon Oct 25, 2010 5:49 am    Post subject: Reply with quote

[Solved] Phone Number Formatting
_________________
Rest in peace, oooforum.org
Get help on http://forum.openoffice.org
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group