Or login with:
| char*number_format_c( | double | value | |
| int | dp = 0 | ||
| char | dec_point = '.' | ||
| char | thousand_sep = ',' | ) |
#include <stdio.h> #include <codecogs/computing/io/format/number_format.h> int main () { char* a=IO::Format::number_format_c(234.38645,2); printf("\n%s", a); delete[](a); }
234.39| value | The number to be converted into a text string. |
| dp | The number of decimal places to truncate the number to. dp has a range from 0 to 19. (default =0) |
| dec_point | is the character to be used as a decimal point. (default='.') |
| thousand_sep | Character to be inserted after every 3 digits. (default=',') |
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
| std::stringnumber_format( | double | value | |
| int | dp = 0 | ||
| char | dec_point = '.' | ||
| char | thousand_sep = ',' | ) |
#include <stdio.h> #include <codecogs/computing/io/format/number_format.h> using namespace IO::Format; int main () { printf("\n%s", number_format(22.38645,2).c_str()); printf("\n%s", number_format(122.38245,2).c_str()); printf("\n%s", number_format(4122.38645,2).c_str()); printf("\n%s", number_format(-57000000,2,'.',':').c_str()); printf("\n%s", number_format(-1234.567,2,'.',':').c_str()); printf("\n%s", number_format(-987.654,2,'.',':').c_str()); }
22.39 122.38 4,122.39 -57:000:000.00 -1:234.57 -987.65
| value | The number to be converted into a text string. |
| dp | The number of decimal places to truncate the number to. dp has a range from 0 to 19. (default =0) |
| dec_point | is the character to be used as a decimal point. (default='.') |
| thousand_sep | Character to be inserted after every 3 digits. (default=',') |
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
You must login to leave a messge