[Openroad-users] Problems formatting Floats
Bodo Bergmann
Bodo.Bergmann at ingres.com
Fri May 11 17:49:45 EST 2007
This is possible as FormatString is an CellAttribute attribute.
So you can use:
FIELD(tf[row].col).FormatString = 'zzn.zzzzz';
for the rows that require it.
Bodo.
Bodo Bergmann
Senior Software Engineer
OpenROAD Worldwide Development
Ingres Corp.
________________________________
From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Bloomfield,
Martin (PSD)
Sent: Friday, May 11, 2007 9:31 AM
To: International OpenROAD Users
Subject: Re: [Openroad-users] Problems formatting Floats
Thanks for this. I have been using the FormatString for individual
entry fields and it works fine. The area I'm having the problem with is
a tablefield. In this table, I have one column which is normally 3dp
(formatted as zzn.zzz). However, we have two potential records where
this value is 5dp. This requires zzn.zzzzz to display properly. This
results in all values now having two extra 0s at the end.
Is it possible to change the formatstring on an individual "cell" in a
tablefield? I've not had any success doing this, as it only seems
possible to change it on the protofield.
Thanks
Martin Bloomfield.
From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Collins,
William - ES/EW
Sent: 10 May 2007 19:22
To: International OpenROAD Users
Subject: Re: [Openroad-users] Problems formatting Floats
Oops! That +n2.3 should be +n5.3 and que should be cue.
________________________________
From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Collins,
William - ES/EW
Sent: Thursday, May 10, 2007 2:10 PM
To: International OpenROAD Users
Subject: Re: [Openroad-users] Problems formatting Floats
Martin,
We too have varying precisions on different float fields. We set the
FormatString for the EntryField to reflect the actual precision allowed
for that number, for example +n2.3 or +n5.2. I'm not sure this will give
you what you want, because it does display trailing zeros to the level
of precision that is available, but our users seem to like it as it
gives them a visual que as to the precision allowed.
Examples:
+n2.3 value 1.01 displays 1.010
+n5.2 value 1.1 displays 1.10
_____________________________________________
From: openroad-users-bounces at peerlessit.com
[mailto:openroad-users-bounces at peerlessit.com
<mailto:openroad-users-bounces at peerlessit.com> ] On Behalf Of
Bloomfield, Martin (PSD)
Sent: Tuesday, May 08, 2007 12:02 PM
To: Openroad-Users
Subject: Problems formatting Floats
I am developing an application that needs to display fairly small
numbers (0.00001). By default, OpenROAD only displays 3 digits after
the decimal point of a float, so I have set the Ingres flag -f8F10.5 at
the application level to achieve the required precision level.
This works fine when I actually have a number this small. However, 99%
of the time, the number only has 3 decimal places. I do not want the
trailing 0s displayed, as this detracts from the actual values and makes
visual validation of the data difficult (as well as implying precision
that does not exist). I've tried applying a field Format String of
zzz.zzzzz. If the number is less than 1, the 0s before the decimal
point are not displayed. However, all of the 0s after the decimal point
are displayed. This results in a value of 0.002 being displayed as
0.00200.
Does anyone know how to fix this problem? I have a mixture of
individual entry fields and table fields which need this formatting
applied to. I have a procedure to strip the trailing 0s from a varchar
representation of the value when sending the data to a report, but want
to avoid having to handle varchars and floats for the same value in the
application frame.
I am running OpenROAD 4.1 SP2 and Ingres 2.6 on Windows XP.
Thanks,
Martin Bloomfield.
____________________________________________
Application Developer & Database Administrator
IT Branch,
Pesticides Safety Directorate
YORK
Email: martin.bloomfield at psd.defra.gsi.gov.uk
<mailto:martin.bloomfield at psd.defra.gsi.gov.uk>
Website: www.pesticides.gov.uk <http://www.pesticides.gov.uk>
P Save a tree... please don't print this e-mail unless you really need
to
<< File: ATT928182.txt >>
*****************************************************************
This e-mail and any files transmitted with it may be proprietary
and are intended solely for the use of the individual or entity to
whom they are addressed. If you have received this e-mail in
error please notify the sender. Please note that any views or
opinions presented in this e-mail are solely those of the author
and do not necessarily represent those of ITT Corporation. The
recipient should check this e-mail and any attachments for the
presence of viruses. ITT accepts no liability for any damage
caused by any virus transmitted by this e-mail.
*******************************************************************
*****************************************************************
This e-mail and any files transmitted with it may be proprietary
and are intended solely for the use of the individual or entity to
whom they are addressed. If you have received this e-mail in
error please notify the sender. Please note that any views or
opinions presented in this e-mail are solely those of the author
and do not necessarily represent those of ITT Corporation. The
recipient should check this e-mail and any attachments for the
presence of viruses. ITT accepts no liability for any damage
caused by any virus transmitted by this e-mail.
*******************************************************************
Department for Environment, Food and Rural Affairs (Defra)
This email and any attachments is intended for the named recipient only.
If you have received it in error you have no authority to use, disclose,
store or copy any of its contents and you should destroy it and inform
the sender.
Whilst this email and associated attachments will have been checked
for known viruses whilst within Defra systems we can accept no
responsibility once it has left our systems.
Communications on Defra's computer systems may be monitored and/or
recorded to secure the effective operation of the system and for other
lawful purposes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://peerlessit.com/pipermail/openroad-users/attachments/20070511/40b6fefe/attachment.html
More information about the Openroad-users
mailing list