PLN amount in words (kwota słownie)
1.6
plntowo
amount_example.c
Go to the documentation of this file.
1
26
#include <stdio.h>
27
#include <stdlib.h>
28
#include <stdint.h>
29
#include "
plntowords.h
"
30
31
int
32
main
(
void
)
33
{
34
char
*result = NULL;
/* String with price */
35
double
d_price = 0;
/* Price in double format */
36
uint64_t ui_price = 0;
/* Price in unsigned int format */
37
38
d_price = 123456789.01;
39
ui_price = (uint64_t) (d_price * 100.0);
40
41
result =
pln_amount_txt_double
(d_price);
42
printf (
"amount : %.2f\n"
, d_price);
43
printf (
"result : %s\n\n"
, result);
44
free (result);
45
46
result =
pln_amount_txt
(ui_price);
47
printf (
"amount : %.2f\n"
, (
double
) ui_price / 100.0);
48
printf (
"result : %s\n\n"
, result);
49
free (result);
50
51
d_price = 10.20;
52
result =
pln_amount_txt_double
(d_price);
53
printf (
"amount : %.2f\n"
, d_price);
54
printf (
"result : %s\n\n"
, result);
55
free (result);
56
57
d_price = 255.43;
58
result =
pln_amount_txt_double
(d_price);
59
printf (
"amount : %.2f\n"
, d_price);
60
printf (
"result : %s\n\n"
, result);
61
free (result);
62
63
d_price = 253.33;
64
result =
pln_amount_txt_double
(d_price);
65
printf (
"amount : %.2f\n"
, d_price);
66
printf (
"result : %s\n\n"
, result);
67
free (result);
68
69
d_price = 1301.21;
70
result =
pln_amount_txt_double
(d_price);
71
printf (
"amount : %.2f\n"
, d_price);
72
printf (
"result : %s\n\n"
, result);
73
free (result);
74
75
d_price = 51609.34;
76
result =
pln_amount_txt_double
(d_price);
77
printf (
"amount : %.2f\n"
, d_price);
78
printf (
"result : %s\n\n"
, result);
79
free (result);
80
81
result =
pln_amount_txt
(5160934);
82
printf (
"amount : %.2f\n"
, d_price);
83
printf (
"result : %s\n\n"
, result);
84
free (result);
85
86
d_price = 268106.00;
87
result =
pln_amount_txt_double
(d_price);
88
printf (
"amount : %.2f\n"
, d_price);
89
printf (
"result : %s\n\n"
, result);
90
free (result);
91
92
d_price = 2040107.01;
93
result =
pln_amount_txt_double
(d_price);
94
printf (
"amount : %.2f\n"
, d_price);
95
printf (
"result : %s\n\n"
, result);
96
free (result);
97
98
d_price = 49100402.10;
99
result =
pln_amount_txt_double
(d_price);
100
printf (
"amount : %.2f\n"
, d_price);
101
printf (
"result : %s\n\n"
, result);
102
free (result);
103
104
d_price = 701589401.50;
105
result =
pln_amount_txt_double
(d_price);
106
printf (
"amount : %.2f\n"
, d_price);
107
printf (
"result : %s\n\n"
, result);
108
free (result);
109
110
d_price = 9018281042.00;
111
result =
pln_amount_txt_double
(d_price);
112
printf (
"amount : %.2f\n"
, d_price);
113
printf (
"result : %s\n\n"
, result);
114
free (result);
115
return
0;
116
}
117
plntowords.h
PLN numerical amount in words.
pln_amount_txt
char * pln_amount_txt(uint64_t ui_inprice)
Function converts price (in PLN) given as an integer number to a word version.
Definition:
plntowords.c:218
main
int main(void)
Definition:
amount_example.c:32
pln_amount_txt_double
char * pln_amount_txt_double(double d_price)
Function converts price (in PLN) given as a floating point number to a word version.
Definition:
plntowords.c:203
Generated by
1.8.17