Teen Programmers Unite  
 

 

Return to forum top

Borland C++ Builder Precision

Posted by 142857 [send private reply] at March 29, 2003, 10:33:23 PM

Does anyone know how to set the precision on some label boxes I'm using in Borland C++ Builder 6? For example, I want 1.1643, and it displays 1.1643002526...

Thanks

Posted by CViper [send private reply] at March 30, 2003, 04:39:59 AM

you could sprintf( buff, "%1.4f", your_float ); Then set the label to buff.

Posted by 142857 [send private reply] at March 30, 2003, 08:50:36 AM

never mind--i found

AnsiString FloatToStrF(
long double value, TStringFloatFormat format,
int precision, int digits);

Posted by CViper [send private reply] at March 30, 2003, 11:11:07 AM

guess that's the long version of it ;)

You must be logged in to post messages and see which you have already read.

Log on
Username:
Password:
Save for later automatic logon

Register as a new user
 
Copyright TPU 2002. See the Credits and About TPU for more information.