Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how I can cut a float value?

Status
Not open for further replies.

rick05

Programmer
Feb 23, 2001
15
MX
Hi guys,

I have a question...

if I have a function that give me a value like this:

x=10.123123123143353543534 or something similar

but I want only a a value like this:

x=10.12312

I say only 5 positions or a specific number of positions of that value

is there any function that does this?

I hope U can helpme

mmmm..

if it is not a lot to request, I will start my vacations from tomorrow, could you send your answer to esalas@chajul.ine.gob.mx, and xineohp@aketzali.super.unam.mx?

I will thank you a lot.

rick

 
in my opinion *scanf* family has all formating posibilities. John Fill
1c.bmp


ivfmd@mail.md
 
I believe set precision may do it too but I am not 100% sure. I have not used it before but back in college, I know some classes needed to use this for values such as pie etc...

Matt
 
Check out this in BCB help files FloatToStrF(...) I would have added the info, but since my BCB is not installed at the moment, if I can I will add it later today!! My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
using printf();
for eg

float f=x=10.123123123143353543534;

printf("%.5f",f);


With Regards
Murali.S

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top