Is it possible to put a currency symbol before rounding off the values ? or Alternatives maybe .  echo number_format((float)$overall_total, 2, '.', ''); //748.10   Expected output should be : $ 748.10
55076
How do you convert a number to a string showing dollars and cents?  eg: 123.45    =&gt; '$123.45' 123.456   =&gt; '$123.46' 123       =&gt; '$123.00' .13       =&gt; '$0.13' .1        =&gt; '$0.10' 0         =&gt; '$0.00'
26607
Is the concept of even/odd numbers applicable to decimal numbers? For e.g. - 4.222 is a even number?
40138
What's the proper way to convert from a scientific notation string such as "1.234567E-06" to a floating point variable using C#?
8030
In German the comma rather than the period is used as a decimal separator and the dot is used as a thousands separator: 12.345,67. The comma creates some unwanted space when used as in $12.345,67$. Is there a light-weight package or some macro to support this? (I'm not looking for automatic formatting like insertion of a thousands separator.)  \documentclass{minimal} \usepackage[utf8]{inputenc}  \begin{document} Der Preis beträgt $12.345,67$ Euro.     \end{document}     An easy fix is typing $12.345,{}67$ but I think this is too cumbersome.
3536
Possible Duplicate:          I want to truncate the decimals like below  i.e.   2.22939393 -> 2.229 2.22977777 -> 2.229
45046
I've started a new job and it involves looking at a bunch of big numbers. Is there an easy way to add commas to an int or decimal field to make it readable?  For example, SQL Server outputs the column on the left, but for my own sanity, I need it to look like the one on the right:  2036150 -&gt; 2,036,150     ...or would I have to write some heinous   left(right(vandalized_data),6),3) + ',' + right(left(vandalized_data),6),3)   function?  The perfect thing would be commas in the display grid, then plain integers in the output.
33452
In a shell script, I'm processing, some addition process will print an output. If it is a single-digit one, then it has to add zero as a prefix. Here is my current script: c_year=2020 for i in {01..11}         do               n_year=2020             echo 'Next Year:'$n_year             if [[ $i == 11 ]]             then n_month=12             echo 'Next Month:'$n_month             else              n_month=$(($i + 1))             echo 'Next Month:'$n_month             fi             echo $date&quot; : Processing data '$c_year-$i-01 00:00:00' and '$n_year-$n_month-01 00:00:00'&quot;         done  The i value is in doule digit, but the n_month is still printing single digit. How do I set default shell output should return as double digit? Or any alternate way to solve this?
104083
Is there a standard TeX or LaTeX code for a symbol that bears the same relation to  \prec\prec that \ll bears to &lt;&lt; ?  (And how do I get TeX code to get rendered in a question posted here?  I'm accustomed to writing things like $\sum_{n=0}^\infty \frac{x^n}{n!}$ on math.stackexchange.com and having it look the way you'd expect it to.)
71533
Can I add the comma "," to force the decimals to remove from the attribute and replace with the number?   For example, I have an Acres field column that says 506320.0750 and I want to replace the decimal with the comma, say 506,320? I want that number to be permanment.   Is that possible? I'm using ArcGIS Desktop 9.3.1
52629
Is there any way I can specify a standard or custom numeric format string to always output the sign, be it +ve or -ve (although what it should do for zero, I'm not sure!)
70051
How can I format Floats in Java so that the float component is displayed only if it's not zero? For example:   123.45 -> 123.45 99.0   -> 99 23.2   -> 23.2 45.0   -> 45   Edit: I forgot to mention - I'm still on Java 1.4 - sorry!
87887
I need a simple floating point rounding function, thus:   double round(double);  round(0.1) = 0 round(-0.1) = 0 round(-0.9) = -1   I can find ceil() and floor() in the math.h - but not round().  Is it present in the standard C++ library under another name, or is it missing??
7653
public class doublePrecision {     public static void main(String[] args) {          double total = 0;         total += 5.6;         total += 5.8;         System.out.println(total);     } }   The above code prints:  11.399999999999   How would I get this to just print (or be able to use it as) 11.4?
63306
How can we extract the decimal part of a floating point number and store the decimal part and the integer part into two separate integer variables?
102992
I  have come up with the following expression to convert 5.1234   to   5° 7`24.24"   toint ($x) || '° ' || toint((($x) - toint ($x)) * 60) ||'`' || substr( (tostring(((($x) - toint ($x)) * 60) - toint((($x) - toint ($x)) * 60)) * 60),1,5) || '"'  Here’s the problem : for some  points such as 5.1234, it works. but for others,  it doesn’t.  I suspect the problem is the integer conversion which round up the decimal figures instead of truncating it.  Is there any other option? thanks.
2827
What's the cleanest, most effective way to validate decimal numbers in JavaScript?  Bonus points for:   Clarity. Solution should be clean and simple. Cross-platform.   Test cases:  01. IsNumeric('-1')      =&gt; true 02. IsNumeric('-1.5')    =&gt; true 03. IsNumeric('0')       =&gt; true 04. IsNumeric('0.42')    =&gt; true 05. IsNumeric('.42')     =&gt; true 06. IsNumeric('99,999')  =&gt; false 07. IsNumeric('0x89f')   =&gt; false 08. IsNumeric('#abcdef') =&gt; false 09. IsNumeric('1.2.3')   =&gt; false 10. IsNumeric('')        =&gt; false 11. IsNumeric('blah')    =&gt; false
63831
I typed up an assignment with a lot of numbers in LaTeX and turned it in to my adviser.  When he returned it to me with some corrections, one of which was a lot of $ around my numbers.  I understand that $ are necessary around some mathematical formulas, but I was just using numbers like -2 and 4.  I did not see any change in the font of the numbers when I added the $ either.  Since my adviser did not want to give me an explanation, what is the rationale?