|
|
outputing text
Hi,
I want to print most significant digit of a number
eg. if its 1.234455666, I want to print 1.23445
if it is 123.123456, I want to print 123.123
I tried using printf("%6f",value); but it means placing 6 digit of
decimal value.
I want to have total of 6 digits only.
how do I do this?
Thanks
|
|
0
|
|
|
|
Reply
|
a.k.vora (41)
|
9/26/2008 10:32:04 PM |
|
Neel wrote:
> Hi,
> I want to print most significant digit of a number
>
> eg. if its 1.234455666, I want to print 1.23445
> if it is 123.123456, I want to print 123.123
>
> I tried using printf("%6f",value); but it means placing 6 digit of
> decimal value.
>
> I want to have total of 6 digits only.
> how do I do this?
>
> Thanks
You want to do printf("%6g",value);
g is for double in scientific format (ie number of sig figs)
|
|
0
|
|
|
|
Reply
|
mistere8416 (9)
|
9/26/2008 10:54:49 PM
|
|
>
> You want to do printf("%6g",value);
>
> g is for double in scientific format (ie number of sig figs)
You might also want to look at this:
http://www.thinkage.ca/english/gcos/expl/nsc/lib/printf.html
I didn't know there were so many possibilities that were actually ANSI,
wonder what C99 etc says about this
|
|
0
|
|
|
|
Reply
|
mistere8416 (9)
|
9/27/2008 3:06:07 AM
|
|
MisterE wrote:
>
>>
>> You want to do printf("%6g",value);
>>
>> g is for double in scientific format (ie number of sig figs)
>
> You might also want to look at this:
> http://www.thinkage.ca/english/gcos/expl/nsc/lib/printf.html
>
> I didn't know there were so many possibilities that were actually ANSI,
> wonder what C99 etc says about this
What that document refers to as the the "type" field is a combination of
what C99 calls length modifiers and conversion specifiers.
C99 adds the following length specifiers: hh (signed char) ll (long
long), j (intmax_t), z (size_t), t (ptrdiff_t). When combined with
conversion specifiers for unsigned types, the first three all refer to
the corresponding unsigned type.
C99 also adds two new conversion specifiers: a,A: hexadecimal floating point
|
|
0
|
|
|
|
Reply
|
jameskuyper (5168)
|
9/27/2008 1:37:33 PM
|
|
|
3 Replies
32 Views
(page loaded in 1.784 seconds)
Similiar Articles: How can I also dump all the console output to a text file? - comp ...When I run my applications in forground (or in background) I can see their console output on my terminal. How can I also dump all the console output to a text file? printed PDF output partially corrupted (characters are modified ...Hello group, I have read the entire FAQ and I believe to have done sufficient research before posting here. The problem I encounter is as follows. P... Change font, fontsize in publish output - comp.soft-sys.matlab ...goptions Axis font size and type - comp.soft-sys.sas... of the graphics output area ... We have req that the font >> size of text in the graph is 7-10pt font ... Run awk95 using VBA Shell(...) in Excel 2000 - comp.lang.awk ...This works from the DOS prompt in c:\filepath\: c:\filepath\awk95 "/^ $/{nextfile} 1" c:\filepath\input.txt > c:\filepath\output.text The following does not work ... ActivePDF WebGrabber IEEngine and White Text - comp.text.pdf ...pdftotext garbled output - comp.text.pdf | Computer Group Hello to everybody ! I have a problem with a pdf file. When I ... ActivePDF WebGrabber IEEngine and White Text 7 ... Redirect stderr/stdout to a file using SetStdHandle - comp.os.ms ...Output text goes = to console instead of file. Any ideas? By the time that your code comes to execute, your runtime library has = already queried Win32 for the ... how to put my pdf "file" (actually a byte array) into iText PDF ...how to put my pdf "file" (actually a byte array) into iText PDF output stream? Follow Max file size for ODS RTF output. - comp.soft-sys.sasOutput as Rich Text Format (rtf ... specific RTF file . Output ODS ... Sample Size = 48 . To select specific tables of the output you use the “SELECT” statement: ODS ... No output produced in latex - comp.text.texHi All, I already had Latex working perfectly fine on my machine with Windows XP. I heard somethings about LyX..and wanted to try it out. But that ... Extract Information from Tens of Thousands of Different PDFs ...Some examples - text character positions can be reversed between the input PDF and the output text, some text characters may be left out, etc. Output Text in MATLAB | eHow.comMATLAB is a versatile computer program capable of all levels of math, figure plotting, programming, and signal processing. You may want to output some text to the ... T223 'C' Tutorial - Outputting text to the screenT223 C Tutorial 2. The required code for any of C,s source code and how to Output text to the screen using C's built in functions. 7/8/2012 1:32:56 PM
|
|
|
|
|
|
|
|
|