![]() |
| ||
| Looking for _gcvt(double,int,string) I found this neat little GUI calculator program on the net. It uses a function called _gcvt(double val,int limit,string cBuf), which seems to be used to convert a double val to a string cBuf, with some formatting and limiting. I replaced it with sprintf(), but the output looks rather crude to the perfectionist. xfind.exe can find _gcvt in a few header files, but Dev C++ does not respond to it. Does anybody have some past experience with it? |
| ||
| Re: Looking for _gcvt(double,int,string) _gcvt is a Visual Studio function. sprintf should work fine provided you consider limit as the number of significant precision digits. >but the output looks rather crude to the perfectionist. How appropriately vague. Care to be more specific? |
| ||
| Re: Looking for _gcvt(double,int,string) Thanks for the answer! I will use sprintf(), but need to adjust the precision digits to something sensible. 2.3 + 3.4 = 5.700000000 looks silly! I had the notion that _gcvt might do this. |
| ||
| Re: Looking for _gcvt(double,int,string) >2.3 + 3.4 = 5.700000000 looks silly! You can specify a precision with sprintf: sprintf ( cBuf, "%.*f", limit, val ); |
| ||
| Re: Looking for _gcvt(double,int,string) Quote:
|
| All times are GMT -4. The time now is 12:26 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC