[Openroad-users] Problems formatting Floats

Bloomfield, Martin (PSD) Martin.Bloomfield at psd.defra.gsi.gov.uk
Wed May 9 02:02:25 EST 2007


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
Website: www.pesticides.gov.uk

P Save a tree... please don't print this e-mail unless you really need
to

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 --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 10407 bytes
Desc: not available
Url : http://peerlessit.com/pipermail/openroad-users/attachments/20070508/505f3f9c/attachment.bin 


More information about the Openroad-users mailing list