forked from MarinaPlanells/jsCurrencyFormat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
128 lines (127 loc) · 4.23 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html>
<head>
<title>Formateo de números</title>
<script type="text/javascript" src="./js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="./js/currencyFormatter.min.js"></script>
</head>
<body>
<h1>CurrencyFormatter.js</h1>
<h2>Contenido de unas celdas formateado</h2>
<table cellpadding="5" cellspacing="0" border="1">
<tr>
<th>String</th>
<th>Español</th>
<th>Francés</th>
<th>Alemán</th>
<th>Inglés</th>
<th>Italiano</th>
</tr>
<tr>
<td>25</td>
<td class="num">25</td>
<td class="numFr">25</td>
<td class="numDe">25</td>
<td class="numUk">25</td>
<td class="numIt">25</td>
</tr>
<tr>
<td>215.50</td>
<td class="num">215.50</td>
<td class="numFr">215.50</td>
<td class="numDe">215.50</td>
<td class="numUk">215.50</td>
<td class="numIt">215.50</td>
</tr>
<tr>
<td>1 259.74</td>
<td class="num">1 259.74</td>
<td class="numFr">1 259.74</td>
<td class="numDe">1 259.74</td>
<td class="numUk">1 259.74</td>
<td class="numIt">1 259.74</td>
</tr>
<tr>
<td>1,874.56</td>
<td class="num">1,874.56</td>
<td class="numFr">1,874.56</td>
<td class="numDe">1,874.56</td>
<td class="numUk">1,874.56</td>
<td class="numIt">1,874.56</td>
</tr>
<tr>
<td>54871254.36</td>
<td class="num">54871254.36</td>
<td class="numFr">54871254.36</td>
<td class="numDe">54871254.36</td>
<td class="numUk">54871254.36</td>
<td class="numIt">54871254.36</td>
</tr>
<tr>
<td>25,85</td>
<td class="num">25,85</td>
<td class="numFr">25,85</td>
<td class="numDe">25,85</td>
<td class="numUk">25,85</td>
<td class="numIt">25,85</td>
</tr>
<tr>
<td>1.523,56</td>
<td class="num">1.523,56</td>
<td class="numFr">1.523,56</td>
<td class="numDe">1.523,56</td>
<td class="numUk">1.523,56</td>
<td class="numIt">1.523,56</td>
</tr>
<tr>
<td>16.256.523,56</td>
<td class="num">16.256.523,56</td>
<td class="numFr">16.256.523,56</td>
<td class="numDe">16.256.523,56</td>
<td class="numUk">16.256.523,56</td>
<td class="numIt">16.256.523,56</td>
</tr>
</table>
<h2>Contenido de unos campos input formateado</h2>
<p>Input text a formato español: <input class="num" type="text" value="16.256.523,56"/></p>
<p>Input text a formato francés: <input class="numFr" type="text" value="16.256.523,56"/></p>
<p>Input text a formato alemán: <input class="numDe" type="text" value="16.256.523,56"/></p>
<p>Input text a formato inglés: <input class="numUk" type="text" value="16.256.523,56"/></p>
<p>Input text a formato italiano: <input class="numIt" type="text" value="16.256.523,56"/></p>
<h2>Contenido de un span formateado y con mostrado de símbolo</h2>
<p>Formato español: <span id="curEs">102547.56</span></p>
<p>Formato francés: <span id="curFr">102547.56</span></p>
<p>Formato inglés: <span id="curUk">102547.56</span></p>
<p>Formato aleman: <span id="curDe">102547.56</span></p>
<p>Formato italiano: <span id="curIt">102547.56</span></p>
<script>
$(document).ready(function(){
$('.num').currencyFormatter({lang: 'es'});
$('.numFr').currencyFormatter({lang: 'fr'});
$('.numDe').currencyFormatter({lang: 'de'});
$('.numUk').currencyFormatter({lang: 'uk'});
$('.numIt').currencyFormatter({lang: 'it'});
$('#curEs').currencyFormatter({
lang: 'es',
showCurrency: true
});
$('#curFr').currencyFormatter({
lang: 'fr',
showCurrency: true
});
$('#curDe').currencyFormatter({
lang: 'de',
showCurrency: true
});
$('#curUk').currencyFormatter({
lang: 'uk',
showCurrency: true
});
$('#curIt').currencyFormatter({
lang: 'it',
showCurrency: true
});
});
</script>
</body>
</html>