Logo

Programming-Idioms

History of Idiom 65 > diff from v6 to v7

Edit summary for version 7 by :

Version 6

2015-08-18, 17:36:24

Version 7

2015-08-20, 11:02:49

Idiom #65 Format decimal number

From real value x in [0,1], create its percentage string representation s with one digit after decimal point. E.g. 0.15625 -> "15.6%"

Idiom #65 Format decimal number

From real value x in [0,1], create its percentage string representation s with one digit after decimal point. E.g. 0.15625 -> "15.6%"

Imports
#include <stdio.h>
Code
printf("%.1lf%%\n",x);