@@ -13,11 +13,11 @@ msgstr ""
13
13
14
14
#: ../source/tutorial/model-monetary-data.txt:3
15
15
msgid "Model Monetary Data"
16
- msgstr ""
16
+ msgstr "货币数据建模 "
17
17
18
18
#: ../source/tutorial/model-monetary-data.txt:8
19
19
msgid "Overview"
20
- msgstr ""
20
+ msgstr "概述 "
21
21
22
22
#: ../source/tutorial/model-monetary-data.txt:10
23
23
msgid ""
@@ -29,46 +29,58 @@ msgid ""
29
29
" addition, some fractional numeric quantities, such as one third and one "
30
30
"tenth, have no exact representation in binary floating point numbers."
31
31
msgstr ""
32
+ "MongoDB里面的数字字段类型是IEEE 754标准定义的64为浮点数以及32位或64位有符号整数。"
33
+ "而一些金融或财务方面的应用经常需要存储一些货币的小数点值。但是当前计算机内实现的浮点数"
34
+ "计算能力往往不能满足金融代数的要求。另外浮点数也无法准确地表示1/3或者1/10这样的分数。"
32
35
33
36
#: ../source/tutorial/model-monetary-data.txt:21
34
37
msgid ""
35
38
"Arithmetic mentioned on this page refers to server-side arithmetic performed"
36
39
" by :program:`mongod` or :program:`mongos`, and not to client-side "
37
40
"arithmetic."
38
41
msgstr ""
42
+ "本文提及的数学计算指的是在服务器端由 :program:`mongod` or :program:`mongos` 执行的计算"
43
+ "而非客户端的计算。"
39
44
40
45
#: ../source/tutorial/model-monetary-data.txt:25
41
46
msgid "This document describes two ways to model monetary data in MongoDB:"
42
- msgstr ""
47
+ msgstr "这篇文章描述了两种对货币数据的建模方法。 "
43
48
44
49
#: ../source/tutorial/model-monetary-data.txt:27
45
50
msgid ""
46
51
":ref:`monetary-value-exact-precision` which multiplies the monetary value by"
47
52
" a power of 10."
48
53
msgstr ""
54
+ ":ref:`monetary-value-exact-precision` 把货币值乘以10的次方数。"
55
+
49
56
50
57
#: ../source/tutorial/model-monetary-data.txt:30
51
58
msgid ""
52
59
":ref:`monetary-value-arbitrary-precision` which uses two fields for the "
53
60
"value: one field to store the exact monetary value as a non-numeric and "
54
61
"another field to store a floating point approximation of the value."
55
62
msgstr ""
63
+ ":ref:`monetary-value-arbitrary-precision` 使用两个字段,一个字段以非数字形式保存"
64
+ "真实地货币数值,一个字段则以浮点数的形式保存这个货币数值的大约值。"
56
65
57
66
#: ../source/tutorial/model-monetary-data.txt:38
58
67
msgid "Use Cases for Exact Precision Model"
59
- msgstr ""
68
+ msgstr "准确精度的应用场景 "
60
69
61
70
#: ../source/tutorial/model-monetary-data.txt:40
62
71
msgid ""
63
72
"If you regularly need to perform server-side arithmetic on monetary data, "
64
73
"the exact precision model may be appropriate. For instance:"
65
74
msgstr ""
75
+ "如果你经常需要在服务器端做一些对货币数值的数学计算,那么严格精度可能会更合适一点。"
76
+ "例如:"
66
77
67
78
#: ../source/tutorial/model-monetary-data.txt:43
68
79
msgid ""
69
80
"If you need to query the database for exact, mathematically valid matches, "
70
81
"use :ref:`monetary-value-exact-precision`."
71
82
msgstr ""
83
+ "假如你需要对货币数值做完全一致的匹配,那么可以考虑使用 :ref:`monetary-value-exact-precision`。"
72
84
73
85
#: ../source/tutorial/model-monetary-data.txt:46
74
86
msgid ""
@@ -77,44 +89,55 @@ msgid ""
77
89
"</reference/operator/aggregation-arithmetic>`, use :ref:`monetary-value-"
78
90
"exact-precision`."
79
91
msgstr ""
92
+ "假如你需要做一些服务器端的计算,如 :update:`$inc`, "
93
+ ":update:`$mul`, 和 :doc:`aggregation framework arithmetic "
94
+ "</reference/operator/aggregation-arithmetic>`, 那么可以使用 :ref:`monetary-value-"
95
+ "exact-precision`。"
80
96
81
97
#: ../source/tutorial/model-monetary-data.txt:54
82
98
msgid "Use Cases for Arbitrary Precision Model"
83
- msgstr ""
99
+ msgstr "任意精度模式的应用场景 "
84
100
85
101
#: ../source/tutorial/model-monetary-data.txt:56
86
102
msgid ""
87
103
"If there is no need to perform server-side arithmetic on monetary data, "
88
104
"modeling monetary data using the arbitrary precision model may be suitable. "
89
105
"For instance:"
90
106
msgstr ""
107
+ "如果没有在服务器端对货币数值进行计算的需要,那么使用任意精度模式的方式可能更为适合一点。"
108
+ "例如:"
91
109
92
110
#: ../source/tutorial/model-monetary-data.txt:60
93
111
msgid ""
94
112
"If you need to handle arbitrary or unforeseen number of precision, see :ref"
95
113
":`monetary-value-arbitrary-precision`."
96
114
msgstr ""
115
+ "如果你需要处理任意的或者未知的精度,参见"
116
+ " :ref:`monetary-value-arbitrary-precision`。"
97
117
98
118
#: ../source/tutorial/model-monetary-data.txt:63
99
119
msgid ""
100
120
"If server-side approximations are sufficient, possibly with client-side "
101
121
"post-processing, see :ref:`monetary-value-arbitrary-precision`."
102
122
msgstr ""
123
+ "如果服务器端的近似值计算可以满足要求,或者能够利用客户端作进一步处理,那么也可以使用"
124
+ " :ref:`monetary-value-arbitrary-precision`。"
103
125
104
126
#: ../source/tutorial/model-monetary-data.txt:70
105
127
msgid "Exact Precision"
106
- msgstr ""
128
+ msgstr "准确精度 "
107
129
108
130
#: ../source/tutorial/model-monetary-data.txt:72
109
131
msgid "To model monetary data using the exact precision model:"
110
- msgstr ""
132
+ msgstr "使用准确精度建模: "
111
133
112
134
#: ../source/tutorial/model-monetary-data.txt:74
113
135
msgid ""
114
136
"Determine the maximum precision needed for the monetary value. For example, "
115
137
"your application may require precision down to the tenth of one cent for "
116
138
"monetary values in ``USD`` currency."
117
139
msgstr ""
140
+ "确定货币值需要的最高精度。比如说,你的应用程序可能使用十分之一美分作为最小单位。"
118
141
119
142
#: ../source/tutorial/model-monetary-data.txt:78
120
143
msgid ""
@@ -123,20 +146,23 @@ msgid ""
123
146
"significant digit of the integer. For example, if the required maximum "
124
147
"precision is the tenth of one cent, multiply the monetary value by 1000."
125
148
msgstr ""
149
+ "把带小数货币值乘以10的次方数以转换成一个整数。如果最高精度要求是十分之一美分,那么就可以"
150
+ "把值乘以1000。"
126
151
127
152
#: ../source/tutorial/model-monetary-data.txt:84
128
153
msgid "Store the converted monetary value."
129
- msgstr ""
154
+ msgstr "保存转换以后的整形数。 "
130
155
131
156
#: ../source/tutorial/model-monetary-data.txt:86
132
157
msgid ""
133
158
"For example, the following scales ``9.99 USD`` by 1000 to preserve precision"
134
159
" up to one tenth of a cent."
135
160
msgstr ""
161
+ "例如, 下面这个例子把 ``9.99 USD`` 乘以1000进行放大并得到9990。"
136
162
137
163
#: ../source/tutorial/model-monetary-data.txt:93
138
164
msgid "The model assumes that for a given currency value:"
139
- msgstr ""
165
+ msgstr "这个模型假设对于一个特定的货币值: "
140
166
141
167
#: ../source/tutorial/model-monetary-data.txt:95
142
168
msgid ""
@@ -149,45 +175,53 @@ msgid ""
149
175
"The scale factor is a constant and known property of the currency; i.e "
150
176
"applications can determine the scale factor from the currency."
151
177
msgstr ""
178
+ "对货币值的放大因子(乘数)对于一种货币来说是一致的并且应用程序能够确定这个放大因子。"
152
179
153
180
#: ../source/tutorial/model-monetary-data.txt:101
154
181
msgid ""
155
182
"When using this model, applications must be consistent in performing the "
156
183
"appropriate scaling of the values."
157
184
msgstr ""
185
+ "当使用这个模式的时候,应用程序必须始终一致的执行相应值得换算。"
158
186
159
187
#: ../source/tutorial/model-monetary-data.txt:104
160
188
msgid ""
161
189
"For use cases of this model, see :ref:`exact-precision-model-use-case`."
162
190
msgstr ""
191
+ "对这种模式的使用场景,参见 :ref:`exact-precision-model-use-case`。"
163
192
164
193
#: ../source/tutorial/model-monetary-data.txt:109
165
194
msgid "Arbitrary Precision"
166
- msgstr ""
195
+ msgstr "任意精度 "
167
196
168
197
#: ../source/tutorial/model-monetary-data.txt:111
169
198
msgid ""
170
199
"To model monetary data using the arbitrary precision model, store the value "
171
200
"in two fields:"
172
201
msgstr ""
202
+ "使用任意精度方式建模时,我们需要用两个字段来保存货币值:"
173
203
174
204
#: ../source/tutorial/model-monetary-data.txt:114
175
205
msgid ""
176
206
"In one field, encode the exact monetary value as a non-numeric data type; "
177
207
"e.g., ``BinData`` or a ``string``."
178
208
msgstr ""
209
+ "在一个字段里,把货币值原样不动的按照非数字字段进行存储,如"
210
+ " ``BinData`` 或者 ``string``。"
179
211
180
212
#: ../source/tutorial/model-monetary-data.txt:117
181
213
msgid ""
182
214
"In the second field, store a double-precision floating point approximation "
183
215
"of the exact value."
184
216
msgstr ""
217
+ "在另一个字段里,以双精度浮点数近似值的形式保存所需货币值。"
185
218
186
219
#: ../source/tutorial/model-monetary-data.txt:120
187
220
msgid ""
188
221
"The following example uses the arbitrary precision model to store ``9.99 "
189
222
"USD`` for the price and ``0.25 USD`` for the fee:"
190
223
msgstr ""
224
+ "下述例子使用任意精度模式来保存价格字段 ``9.99 USD`` 和费用字段 ``0.25 USD`` :"
191
225
192
226
#: ../source/tutorial/model-monetary-data.txt:130
193
227
msgid ""
@@ -198,8 +232,11 @@ msgid ""
198
232
"exact value and then filter out the returned documents based on the exact "
199
233
"monetary value."
200
234
msgstr ""
235
+ "适当使用的话,应用程序可以执行对货币字段按近似字段的值进行范围查找和排序。然而,使用近似字段"
236
+ "查询排序时应用程序必须做一些后续处理来对非数字型的货币值进行解码转换成数字,然后返回给客户端。"
201
237
202
238
#: ../source/tutorial/model-monetary-data.txt:137
203
239
msgid ""
204
240
"For use cases of this model, see :ref:`arbitrary-precision-model-use-case`."
205
241
msgstr ""
242
+ "对于这种方式的应用场景,参见 :ref:`arbitrary-precision-model-use-case`。"
0 commit comments