[Openroad-users] Problems formatting Floats
Collins, William - ES/EW
William.Collins at itt.com
Fri May 11 04:21:37 EST 2007
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.
*******************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://peerlessit.com/pipermail/openroad-users/attachments/20070510/b08dadae/attachment.html
More information about the Openroad-users
mailing list