473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Float to string CONVERSION

21
HI all,
I tried to convert the floating value to string, so i used like this

sprintf(buffer,"%f",float_varianle);
i compiled using gcc compiler it always prints f. If i compile in VC++ it works fine.
if someone faced the same give heart,,,,,,


Thanks all........
Nov 3 '07 #1
1 1856
Banfa
9,065 Expert Mod 8TB
What platform are you building for?

It is not uncommon for printf floating point support to be left out on embedded platforms where there is no floating point processor as having it in makes printf a very large function since it then has to use a floating point emulation library.

Check you standard library documentation.
Nov 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bryan R. Meyer | last post by:
I am a relatively new C++ programmer and am attempting to write a function that takes a number of type float and adds commas to it in the appropriate places. In order to manipulate the number to...
14
by: Glen Able | last post by:
Should it be possible to create a custom class, 'Float', which would behave as a drop-in replacement for the builtin float type? As mentioned in another thread, I once tried this in rather a...
7
by: Mike | last post by:
I am trying to calculate a 32bit float value from 4 int values. I sucessfully calcluated a 32bit long value: LONG l32BitData = pData; l32BitData <<= 8; l32BitData |= (byte)pData;...
6
by: karthi | last post by:
hi, I need user defined function that converts string to float in c. since the library function atof and strtod occupies large space in my processor memory I can't use it in my code. regards,...
16
by: homa | last post by:
Hi! How do I do to make t-sql not rounding the result that i returned? For example: 0.9616458*60 = 57,698748 (in any calculator) while following: -------------------------------- declare...
34
by: yaniv.dg | last post by:
hi all, i building an equition with float type now,what function should i use in order to identify is someone enter a char value by mistake?
5
by: Thorsten | last post by:
Hi everyone, I am rather new to C# and have a problem that will probably seem trivial to most of you... but I hope you can still help me nevertheless.. Via the comport, I read the result of a...
10
by: Hank Stalica | last post by:
I'm having this weird problem where my code does the following conversion from string to float: 27000000.0 -27000000.00 2973999.99 -29740000.00 2989999.13 -2989999.25 The number on the left...
1
by: malick | last post by:
Hello it developers, I'm using PHPExcelReader which I downloaded from sourceforge (http://sourceforge.net/projects/phpexcelreader) To read excel xls files in php. In the file reader.php (...
14
by: Jim Langston | last post by:
The output of the following program is: 1.#INF 1 But: 1.#INF 1.#INF was expected and desired. How can I read a value of infinity from a stream?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.