| View previous topic :: View next topic |
| Author |
Message |
maurice.pinner Newbie

Joined: 05 Oct 2010 Posts: 2
|
Posted: Tue Oct 05, 2010 1:39 am Post subject: ooBase numeric field leading zero issue |
|
|
How can I stop numerical fields from suppressing leading zeros. _________________ Maurice |
|
| Back to top |
|
 |
keme Moderator


Joined: 30 Aug 2004 Posts: 2732 Location: Egersund, Norway
|
Posted: Tue Oct 05, 2010 2:46 am Post subject: |
|
|
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 |
|
 |
maurice.pinner Newbie

Joined: 05 Oct 2010 Posts: 2
|
Posted: Tue Oct 05, 2010 3:41 am Post subject: |
|
|
| 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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Tue Oct 05, 2010 7:55 am Post subject: |
|
|
| 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 |
|
 |
keme Moderator


Joined: 30 Aug 2004 Posts: 2732 Location: Egersund, Norway
|
Posted: Wed Oct 06, 2010 1:24 am Post subject: |
|
|
| 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 |
|
 |
MSPhobe Super User

Joined: 29 Sep 2005 Posts: 529 Location: England
|
Posted: Mon Oct 25, 2010 4:41 am Post subject: |
|
|
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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
|
| Back to top |
|
 |
|