@@ -13,11 +13,11 @@ msgstr ""
1313
1414#: ../source/tutorial/model-monetary-data.txt:3
1515msgid "Model Monetary Data"
16- msgstr ""
16+ msgstr "货币数据建模 "
1717
1818#: ../source/tutorial/model-monetary-data.txt:8
1919msgid "Overview"
20- msgstr ""
20+ msgstr "概述 "
2121
2222#: ../source/tutorial/model-monetary-data.txt:10
2323msgid ""
@@ -29,46 +29,58 @@ msgid ""
2929" addition, some fractional numeric quantities, such as one third and one "
3030"tenth, have no exact representation in binary floating point numbers."
3131msgstr ""
32+ "MongoDB里面的数字字段类型是IEEE 754标准定义的64为浮点数以及32位或64位有符号整数。"
33+ "而一些金融或财务方面的应用经常需要存储一些货币的小数点值。但是当前计算机内实现的浮点数"
34+ "计算能力往往不能满足金融代数的要求。另外浮点数也无法准确地表示1/3或者1/10这样的分数。"
3235
3336#: ../source/tutorial/model-monetary-data.txt:21
3437msgid ""
3538"Arithmetic mentioned on this page refers to server-side arithmetic performed"
3639" by :program:`mongod` or :program:`mongos`, and not to client-side "
3740"arithmetic."
3841msgstr ""
42+ "本文提及的数学计算指的是在服务器端由 :program:`mongod` or :program:`mongos` 执行的计算"
43+ "而非客户端的计算。"
3944
4045#: ../source/tutorial/model-monetary-data.txt:25
4146msgid "This document describes two ways to model monetary data in MongoDB:"
42- msgstr ""
47+ msgstr "这篇文章描述了两种对货币数据的建模方法。 "
4348
4449#: ../source/tutorial/model-monetary-data.txt:27
4550msgid ""
4651":ref:`monetary-value-exact-precision` which multiplies the monetary value by"
4752" a power of 10."
4853msgstr ""
54+ ":ref:`monetary-value-exact-precision` 把货币值乘以10的次方数。"
55+
4956
5057#: ../source/tutorial/model-monetary-data.txt:30
5158msgid ""
5259":ref:`monetary-value-arbitrary-precision` which uses two fields for the "
5360"value: one field to store the exact monetary value as a non-numeric and "
5461"another field to store a floating point approximation of the value."
5562msgstr ""
63+ ":ref:`monetary-value-arbitrary-precision` 使用两个字段,一个字段以非数字形式保存"
64+ "真实地货币数值,一个字段则以浮点数的形式保存这个货币数值的大约值。"
5665
5766#: ../source/tutorial/model-monetary-data.txt:38
5867msgid "Use Cases for Exact Precision Model"
59- msgstr ""
68+ msgstr "准确精度的应用场景 "
6069
6170#: ../source/tutorial/model-monetary-data.txt:40
6271msgid ""
6372"If you regularly need to perform server-side arithmetic on monetary data, "
6473"the exact precision model may be appropriate. For instance:"
6574msgstr ""
75+ "如果你经常需要在服务器端做一些对货币数值的数学计算,那么严格精度可能会更合适一点。"
76+ "例如:"
6677
6778#: ../source/tutorial/model-monetary-data.txt:43
6879msgid ""
6980"If you need to query the database for exact, mathematically valid matches, "
7081"use :ref:`monetary-value-exact-precision`."
7182msgstr ""
83+ "假如你需要对货币数值做完全一致的匹配,那么可以考虑使用 :ref:`monetary-value-exact-precision`。"
7284
7385#: ../source/tutorial/model-monetary-data.txt:46
7486msgid ""
@@ -77,44 +89,55 @@ msgid ""
7789"</reference/operator/aggregation-arithmetic>`, use :ref:`monetary-value-"
7890"exact-precision`."
7991msgstr ""
92+ "假如你需要做一些服务器端的计算,如 :update:`$inc`, "
93+ ":update:`$mul`, 和 :doc:`aggregation framework arithmetic "
94+ "</reference/operator/aggregation-arithmetic>`, 那么可以使用 :ref:`monetary-value-"
95+ "exact-precision`。"
8096
8197#: ../source/tutorial/model-monetary-data.txt:54
8298msgid "Use Cases for Arbitrary Precision Model"
83- msgstr ""
99+ msgstr "任意精度模式的应用场景 "
84100
85101#: ../source/tutorial/model-monetary-data.txt:56
86102msgid ""
87103"If there is no need to perform server-side arithmetic on monetary data, "
88104"modeling monetary data using the arbitrary precision model may be suitable. "
89105"For instance:"
90106msgstr ""
107+ "如果没有在服务器端对货币数值进行计算的需要,那么使用任意精度模式的方式可能更为适合一点。"
108+ "例如:"
91109
92110#: ../source/tutorial/model-monetary-data.txt:60
93111msgid ""
94112"If you need to handle arbitrary or unforeseen number of precision, see :ref"
95113":`monetary-value-arbitrary-precision`."
96114msgstr ""
115+ "如果你需要处理任意的或者未知的精度,参见"
116+ " :ref:`monetary-value-arbitrary-precision`。"
97117
98118#: ../source/tutorial/model-monetary-data.txt:63
99119msgid ""
100120"If server-side approximations are sufficient, possibly with client-side "
101121"post-processing, see :ref:`monetary-value-arbitrary-precision`."
102122msgstr ""
123+ "如果服务器端的近似值计算可以满足要求,或者能够利用客户端作进一步处理,那么也可以使用"
124+ " :ref:`monetary-value-arbitrary-precision`。"
103125
104126#: ../source/tutorial/model-monetary-data.txt:70
105127msgid "Exact Precision"
106- msgstr ""
128+ msgstr "准确精度 "
107129
108130#: ../source/tutorial/model-monetary-data.txt:72
109131msgid "To model monetary data using the exact precision model:"
110- msgstr ""
132+ msgstr "使用准确精度建模: "
111133
112134#: ../source/tutorial/model-monetary-data.txt:74
113135msgid ""
114136"Determine the maximum precision needed for the monetary value. For example, "
115137"your application may require precision down to the tenth of one cent for "
116138"monetary values in ``USD`` currency."
117139msgstr ""
140+ "确定货币值需要的最高精度。比如说,你的应用程序可能使用十分之一美分作为最小单位。"
118141
119142#: ../source/tutorial/model-monetary-data.txt:78
120143msgid ""
@@ -123,20 +146,23 @@ msgid ""
123146"significant digit of the integer. For example, if the required maximum "
124147"precision is the tenth of one cent, multiply the monetary value by 1000."
125148msgstr ""
149+ "把带小数货币值乘以10的次方数以转换成一个整数。如果最高精度要求是十分之一美分,那么就可以"
150+ "把值乘以1000。"
126151
127152#: ../source/tutorial/model-monetary-data.txt:84
128153msgid "Store the converted monetary value."
129- msgstr ""
154+ msgstr "保存转换以后的整形数。 "
130155
131156#: ../source/tutorial/model-monetary-data.txt:86
132157msgid ""
133158"For example, the following scales ``9.99 USD`` by 1000 to preserve precision"
134159" up to one tenth of a cent."
135160msgstr ""
161+ "例如, 下面这个例子把 ``9.99 USD`` 乘以1000进行放大并得到9990。"
136162
137163#: ../source/tutorial/model-monetary-data.txt:93
138164msgid "The model assumes that for a given currency value:"
139- msgstr ""
165+ msgstr "这个模型假设对于一个特定的货币值: "
140166
141167#: ../source/tutorial/model-monetary-data.txt:95
142168msgid ""
@@ -149,45 +175,53 @@ msgid ""
149175"The scale factor is a constant and known property of the currency; i.e "
150176"applications can determine the scale factor from the currency."
151177msgstr ""
178+ "对货币值的放大因子(乘数)对于一种货币来说是一致的并且应用程序能够确定这个放大因子。"
152179
153180#: ../source/tutorial/model-monetary-data.txt:101
154181msgid ""
155182"When using this model, applications must be consistent in performing the "
156183"appropriate scaling of the values."
157184msgstr ""
185+ "当使用这个模式的时候,应用程序必须始终一致的执行相应值得换算。"
158186
159187#: ../source/tutorial/model-monetary-data.txt:104
160188msgid ""
161189"For use cases of this model, see :ref:`exact-precision-model-use-case`."
162190msgstr ""
191+ "对这种模式的使用场景,参见 :ref:`exact-precision-model-use-case`。"
163192
164193#: ../source/tutorial/model-monetary-data.txt:109
165194msgid "Arbitrary Precision"
166- msgstr ""
195+ msgstr "任意精度 "
167196
168197#: ../source/tutorial/model-monetary-data.txt:111
169198msgid ""
170199"To model monetary data using the arbitrary precision model, store the value "
171200"in two fields:"
172201msgstr ""
202+ "使用任意精度方式建模时,我们需要用两个字段来保存货币值:"
173203
174204#: ../source/tutorial/model-monetary-data.txt:114
175205msgid ""
176206"In one field, encode the exact monetary value as a non-numeric data type; "
177207"e.g., ``BinData`` or a ``string``."
178208msgstr ""
209+ "在一个字段里,把货币值原样不动的按照非数字字段进行存储,如"
210+ " ``BinData`` 或者 ``string``。"
179211
180212#: ../source/tutorial/model-monetary-data.txt:117
181213msgid ""
182214"In the second field, store a double-precision floating point approximation "
183215"of the exact value."
184216msgstr ""
217+ "在另一个字段里,以双精度浮点数近似值的形式保存所需货币值。"
185218
186219#: ../source/tutorial/model-monetary-data.txt:120
187220msgid ""
188221"The following example uses the arbitrary precision model to store ``9.99 "
189222"USD`` for the price and ``0.25 USD`` for the fee:"
190223msgstr ""
224+ "下述例子使用任意精度模式来保存价格字段 ``9.99 USD`` 和费用字段 ``0.25 USD`` :"
191225
192226#: ../source/tutorial/model-monetary-data.txt:130
193227msgid ""
@@ -198,8 +232,11 @@ msgid ""
198232"exact value and then filter out the returned documents based on the exact "
199233"monetary value."
200234msgstr ""
235+ "适当使用的话,应用程序可以执行对货币字段按近似字段的值进行范围查找和排序。然而,使用近似字段"
236+ "查询排序时应用程序必须做一些后续处理来对非数字型的货币值进行解码转换成数字,然后返回给客户端。"
201237
202238#: ../source/tutorial/model-monetary-data.txt:137
203239msgid ""
204240"For use cases of this model, see :ref:`arbitrary-precision-model-use-case`."
205241msgstr ""
242+ "对于这种方式的应用场景,参见 :ref:`arbitrary-precision-model-use-case`。"
0 commit comments