micro-lite-lib 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,843 @@
1
+ # Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## 7.0.2
6
+
7
+ - Fix `Money::Currency.register` exception when table is not initialized.
8
+
9
+ ## 7.0.1
10
+
11
+ - Re-publishing gem to fix file permissions https://github.com/RubyMoney/money/issues/1170
12
+
13
+ ## 7.0.0
14
+
15
+ - **Breaking change**: Require Ruby >= 3.1 and i18n ~> 1.9
16
+ - **Breaking change**: Remove deprecated formatting rules:
17
+ - `:html`
18
+ - `:html_wrap_symbol`
19
+ - `:symbol_position`
20
+ - `:symbol_before_without_space`
21
+ - `:symbol_after_without_space`
22
+ - **Breaking change**: Remove deprecated methods:
23
+ - `Money.infinite_precision`.
24
+ - `Money.infinite_precision=`.
25
+ - `Money#currency_as_string`.
26
+ - `Money#currency_as_string=`.
27
+ - `Money.use_i18n` and `Money.use_i18n=` (use `Money.locale_backend = :i18n` instead).
28
+ - **Breaking change**: Remove legacy locale backend. The default locale backend is now `:currency` which uses currency definitions for formatting.
29
+ - **Breaking change**: Default currency is now `nil` instead of `USD`. If you want to keep the previous behavior, set `Money.default_currency = Money::Currency.new("USD")` in your initializer. Initializing a Money object will raise a `Currency::NoCurrency` if no currency is set.
30
+ - **Breaking change**: The default rounding mode has changed from `BigDecimal::ROUND_HALF_EVEN` to `BigDecimal::ROUND_HALF_UP`. Set it explicitly using `Money.rounding_mode = BigDecimal::ROUND_HALF_EVEN` to keep the previous behavior.
31
+ - **Potential breaking change**: Fix RSD (Serbian Dinar) formatting to be like `12.345,42 RSD`
32
+ - **Potential breaking change**: Fix USDC decimals places from 2 to 6
33
+ - **Potential breaking change**: Fix MGA (Malagasy Ariary) to be a zero-decimal currency (changing subunit_to_unit from 5 to 1)
34
+ - **Potential breaking change**: Remove special handling for Japanese language only
35
+ - **Potential breaking change**: Adjust formatting rules to use i18n translations for `:format`
36
+ - **Potential breaking change**: Not allow divide by zero
37
+ - Updated Armenian Dram sign and HTML entity
38
+ - Updated the Turkmen Manat symbol and HTML entity and added disambiguation symbol for TMM
39
+ - Expose Money::VERSION
40
+ - Fix typo in ILS currency
41
+ - Add Zimbabwe Gold (ZWG) currency
42
+ - Update thousands_separator for CHF
43
+ - Add Caribbean Guilder (XCG) as replacement for Netherlands Antillean Gulden (ANG)
44
+ - Add `Money.strict_eql_compare = true` so that comparing zero amounts with different currencies using `Money#eql?` returns `false`
45
+ ```rb
46
+ Money.new(0, "USD").eql?(Money.new(0, "EUR")) #=> true
47
+ #> [DEPRECATION] Comparing 0 USD with 0 EUR using `#eql?` will return false…
48
+
49
+ Money.strict_eql_compare = true
50
+ Money.new(0, "USD").eql?(Money.new(0, "EUR")) #=> false
51
+ ```
52
+ - Add `Money#to_nearest_cash_value` to return a rounded Money instance to the smallest denomination
53
+ - Deprecate `Money#round_to_nearest_cash_value` in favor of calling `to_nearest_cash_value.fractional`
54
+ - Deprecate `Money#dollars` in favor of `Money#amount`.
55
+ - Deprecate `Money.from_dollars` in favor of `Money.from_amount`.
56
+ - Add `Money::Currency#cents_based?` to check if currency is cents-based
57
+ - Add ability to nest `Money.with_rounding_mode` blocks
58
+ - Allow `nil` to be used as a default_currency
59
+ - Improve performance of `find_by_iso_numeric` method
60
+ - Add ability to nest `Money.with_bank` blocks
61
+ - Refactor `Money::Allocation.generate` to support configurable per-split precision by accepting an Integer as a second argument, fixing allocation failures with large arrays and infinite decimal expansions.
62
+
63
+ ## 6.19.0
64
+
65
+ - Change Peruvian Sol (PEN) decimal mark and thousands separator.
66
+ - Fix deprecation warning for BigDecimal being moved out from stdlib.
67
+ - Improves Precision and Simplifies Allocation Logic
68
+ - explicit declaration of i18n locales
69
+ - Add space to CHF format
70
+ - Update deprecation message to suggest correct formatting.
71
+
72
+ ## 6.18.0
73
+
74
+ - Add second dobra (STN) from São Tomé and Príncipe
75
+ - Add Sierra Leonean (new) leone (SLE) from Sierra Leone
76
+ - Correct South African Rand (ZAR) to use comma decimal mark, and space thousands separator
77
+ - Use euro symbol as html_entity for euro currency
78
+ - Update Georgian Lari symbol
79
+ - Add Ruby 3.1 and 3.2 to the CI matrix
80
+ - Add `Money.from_dollars` alias as a more explicit initializer, it's the same as `Money.from_amount`
81
+ - Mark Croatian Kuna (HRK) as obsolete by moving its definition to the backwards compatibility data source
82
+
83
+ ## 6.17.0
84
+
85
+ - Allow true for `thousands_separator`
86
+
87
+ ## 6.16.0
88
+
89
+ - Add `Money.from_cents` alias as a more explicit initializer, it's the same as `Money.new`
90
+
91
+ ## 6.15.0
92
+
93
+ - Add :delimiter_pattern option to the Formatter
94
+
95
+ ## 6.14.1
96
+
97
+ - Fix CHF format regression introduced in v6.14.0
98
+ - Fix deprecation warning in #format_decimal_part
99
+
100
+ ## 6.14.0
101
+
102
+ - Fix Bahraini dinar symbol
103
+ - Raise exception when default currency is not set or passed as parameter
104
+ - Allow specifying default_bank as a lambda
105
+ - Allow passing a default format in currencies definition only valid without symbol_position
106
+ - Always allow comparison with zero Money
107
+ - Rename Money.infinite_precision to default_infinite_precision
108
+ - Add Currency.reset! method to reload all the default currency definitions
109
+ - Fix edgecase for Money#allocate when applying to array of all zero values
110
+
111
+ ## 6.13.8
112
+ - Update symbol for XOF
113
+ - Update UYU currency symbol
114
+ - Allow double conversion using same bank
115
+ - Warn when using unsafe serializer for rate import
116
+ - Move Icelandic symbol after the amount
117
+
118
+ ## 6.13.7
119
+ - Improve deprecation warnings for the upcoming major release
120
+
121
+ ## 6.13.6
122
+ - Fix a regression introduced in 6.13.5 that broken RatesStore::Memory subclasses
123
+
124
+ ## 6.13.5
125
+ - Raise warning on using Money.default_currency
126
+ - Raise warning on using default Money.rounding_mode
127
+ - Add Second Ouguiya MRU 929 to currency iso file
128
+ - Add symbol for UZS
129
+ - Use monitor for recursive mutual exclusion in RatesStore::Memory
130
+ - Allow passing store as a string to Money::Bank::VariableExchange (to support Rails 6)
131
+
132
+ ## 6.13.4
133
+ - Update currency config for Zambian Kwacha (ZMW)
134
+ - Do not modify options passed to FormattingRules
135
+
136
+ ## 6.13.3
137
+ - Remove specs from the packaged gem
138
+ - Use Currency::Loader directly without extending
139
+ - Add Money.with_rounding_mode as a replacement for calling Money.rounding_mode with a block
140
+ - Fix currency search for two digit ISO numbers
141
+ - Add description to TypeError raised by +/- operations
142
+
143
+ ## 6.13.2
144
+ - Prevent Money initialization with non-finite amounts
145
+ - Convert the fractional value of a Money object to BigDecimal when initializing
146
+ - Offer replacements for currency position deprecations
147
+ - Fix Peruvian Sol symbol
148
+ - Lock i18n to <= 1.2.0 for older (< 2.3) rubies
149
+ - Prevent Divide By Zero in `Money#allocate`
150
+
151
+ ## 6.13.1
152
+ - Add bolívar soberano (VES)
153
+ - Deprecate bolívar fuerte (VEF)
154
+ - Deprecate old `#format` rules passed as a symbol
155
+ - Clarify `use_i18n` deprecation
156
+ - Add `:currency` locale_backend for explicit per-currency localization
157
+
158
+ ## 6.13.0
159
+ - Add :format option to the Formatter
160
+ - Add ruby 2.6.0 support
161
+ - Performance improvement (lazy stringify currency keys)
162
+ - Add `Money.locale_backend` for translation lookups
163
+ - Deprecate `use_i18n` flag in favour of `locale_backend = :i18n`
164
+ - Deprecate old formatting rules in favour of `:format`
165
+ - LVL and LTL are no longer used
166
+ - Add `Currency#iso?` for checking if currency is iso or not
167
+ - Relax versions-lock of `i18n` and `rspec` dependencies
168
+ - Add Bitcoin Cash
169
+ - Fix incorrect behaviour of `Currency#find_by_currency_iso` when given empty input
170
+
171
+ ## 6.12.0
172
+ - Remove caching of `.empty`/`.zero`
173
+ - Preserve assigned bank when rounding
174
+ - Always round the fractional part when calling `#round`
175
+ - Wrap all amount parts when `:html_wrap` option is used
176
+ - Deprecate `#currency_as_string` and `#currency_as_string=` (in favour of `#with_currency`)
177
+ - Add `#with_currency` for swapping the currency
178
+ - Rewrite allocate/split (fixing some penny losing issues)
179
+
180
+ ## 6.11.3
181
+ - Fix regression: if enabled use i18n locales in Money#to_s
182
+
183
+ ## 6.11.2
184
+ - Fix regression: ignore formatting defaults for Money#to_s
185
+
186
+ ## 6.11.1
187
+ - Fix issue with adding non-USD money to zero (used when calling `.sum` on an array)
188
+
189
+ ## 6.11.0
190
+ - Support i18n 1.0
191
+ - Update yard dependency to 0.9.11
192
+ - Support for ruby 2.5.0
193
+ - Add inheritance for currency definitions
194
+ - Added new symbol for bitcoin denomination
195
+ - Specify custom rounding precision when using `infinite_precision`
196
+ - Allow splits with sums greater than 1
197
+ - Prevent arithmetic methods from losing reference to the bank
198
+ - Fix coerced zero numeric subtraction
199
+ - Fix south asian formatting to support whole numbers
200
+ - Refactor formatting logic
201
+
202
+ ## 6.10.1
203
+ - Fix an issue with Money.empty memoization
204
+
205
+ ## 6.10.0
206
+ - Added support for i18n version 0.9
207
+ - Disabled rounding when verifying allocation splits
208
+ - Added Chinese Yuan Offshore (CNH)
209
+ - Fixed html_entity for ARS
210
+ - Fixed KZT symbol
211
+ - Allowed comparing cross currency when both are zero
212
+ - Fixed memory rate store
213
+ - Corrected HUF subunit and thousands separator config
214
+
215
+ ## 6.9.0
216
+ - Extracted heuristics into money-heuristics gem
217
+
218
+ ## 6.8.4
219
+ - Resolving NIO ambiguity with CAD
220
+ - Display the BBD $ symbol before digits
221
+ - Symbol first for NIO and PAB currencies
222
+
223
+ ## 6.8.3
224
+ - Added support for the British Penny (GBX)
225
+ - Fixed LKR currency html_entity symbol
226
+
227
+ ## 6.8.2
228
+ - Removed subunits for HUF
229
+ - Fixed `#from_amount` accepting `nil` as currency_code
230
+ - Relaxed i18n version (< 0.9)
231
+ - Set symbol for UZS
232
+ - Added disambiguate_symbol for XFU
233
+ - Fixed Peruvian Sol name
234
+ - Fixed symbol_first for VND (now `false`)
235
+
236
+ ## 6.8.1
237
+ - Fixed issue with calling `format` on a frozen `Money` object
238
+
239
+ ## 6.8.0
240
+ - Ruby 2.4.0 support
241
+ - Fixed UZS syntax
242
+ - Fixed HUF smallest denomination
243
+ - Fixed ruby 1.9 issues
244
+ - Fixed html entity for COP
245
+ - Updated all currency decimals to ISO-4217
246
+ - Fixed money allocation for negative amounts
247
+ - Fixed symbol_first for RON
248
+ - Fixed disambiguate option when symbol is set to true
249
+ - Fixed thousands separator for CZK
250
+ - Improved formatter performance by precaching I18n calls
251
+
252
+ ## 6.7.1
253
+ - Changed DKK symbol from 'kr' to 'kr.'
254
+ - Improved Money::Formatting#format docs
255
+ - Updated VEF symbol from 'Bs F' to 'Bs'
256
+ - `Currency#exponent` now returns Fixnum
257
+ - Fixed coercion issues
258
+ - Fixed edge case with explicit override of thousands separator and decimal mark
259
+ - `Money#==` will now raise error for non-zero numeric values
260
+ - Fixed divmod
261
+ - Added disambiguation symbol to USD Dollar
262
+ - Use disambiguation symbol when both disambiguate and symbol are true in `format` method
263
+
264
+ ## 6.7.0
265
+ - Changed `Money#<=>` to return `nil` if the comparison is inappropriate. (#584)
266
+ - Remove implicit conversion of values being compared. Only accept `Money` and
267
+ subclasses of `Money` for comparisons and raise TypeError otherwise.
268
+ - When comparing fails due to `Money::Bank::UnknownRate` `Money#<=>` will now
269
+ return `nil` as `Comparable#==` will not rescue exceptions in the next release.
270
+ - Fix `Currency` specs for `#exponent` and `#decimal_places` not making assertions.
271
+ - Fix a couple of Ruby warnings found in specs.
272
+ - Fix `Money#-`,`Money#+` arithmetic for Ruby 2.3+ : check for zero value without using eql? with a Fixnum. (#577)
273
+ - Use `Money#decimal_mark` when formatting with `rounded_infinite_precision` rule
274
+ set to `true`.
275
+ - Replaced meta-defined `thousands_separator` and `decimal_mark` methods with regular methods. (#579)
276
+
277
+ ## 6.6.0
278
+ - Fixed VariableExchange#exchange_with for big numbers.
279
+ - Add Currency symbol translation support
280
+ - `Currency.all` raises a more helpful error message
281
+ (`Currency::MissingAttributeError`)if a currency has no priority
282
+ - `Currency` implements `Enumerable`.
283
+ - `Currency#<=>` sorts alphabetically by `id` if the `priority`s are the same,
284
+ and no longer raises an error if one of the priorities is missing.
285
+ - `Money::Currency.unregister` can take an ISO code argument in addition
286
+ to a hash.
287
+ - `Money::Currency.unregister` returns `true` if the given currency
288
+ previously existed, and `false` if it didn't.
289
+ - Fix symbol for SZL currency
290
+ - Trying to create a Currency without an `iso_code` now raises a more
291
+ helpful error message.
292
+ - Add `Money.usd`, `.cad` and `.eur` as aliases for `.us_dollar`,
293
+ `.ca_dollar`, and `.euro`.
294
+ - Add helper methods for British pounds: `Money.pound_sterling` and
295
+ `Money.gbp`.
296
+ - Add `Money.from_amount` to create money from a value in units instead of
297
+ fractional units.
298
+ - Changed CHF symbol from 'Fr' to 'CHF'
299
+ - Changed CLF exponent from 0 to 4
300
+ - Changed CLP subunit_to_unit from 1 to 100
301
+ - Minor fixes to prevent warnings on unused variables and the redefinition of
302
+ `Money.default_currency`
303
+ - `Money#==` changed to acknowledge that 0 in one currency is equal to 0 in any currency.
304
+ - Changed KRW subunit_to_unit from 100 to 1
305
+ - Decouple exchange rates storage from bank objects and formalize storage public API. Default is `Money::RatesStore::Memory`.
306
+ - `Currency.new` now a singleton by its id
307
+
308
+ ## 6.5.1
309
+ - Fix format for BYR currency
310
+
311
+ ## 6.5.0
312
+ - Add method to round a given amount of money to the nearest possible value in cash (aka Swedish rounding).
313
+ - Fixed the subunit_to_unit values of the CLP and KRW currencies
314
+ - Add option for `disambiguate` symbols for formatting
315
+ - Fixed the subunit_to_unit values of the VND currency
316
+ - Fix formatting of NGN - show symbol before amount
317
+ - Switch default and alternate symbols for RUB currency
318
+ - Fix symbol for TRY currency
319
+ - Add `Money.default_formatting_rules` hash, meant to define default rules for every time `Money#format` is called. They can be overwritten if provided on method call
320
+ - Add support for the new official symbol for Russian Ruble (RUB) — «₽»
321
+
322
+ ## 6.2.1
323
+ - Ensure set is loaded
324
+
325
+ ## 6.2.0
326
+ - Fixes formatting error when both `thousands_separator` and `decimal_mark` was added to Money#format as options.
327
+ - Add Money#to_i which returns the whole part of the value. i.e.
328
+ Money.new(100, "USD").to_i # => 1
329
+ - Fix output on Ukrainian Hryvnia symbol in HTML.
330
+ - Add documentation about i18n in README.
331
+ - Update iso code, symbol, subunit for the new Turkmenistani manat (GH-181)
332
+ - Performance Improvements (1.99x faster on MRI, 1.85x on Rubinius, 41.4x faster on JRuby)
333
+ - Money can now add and subtract Fixnum 0
334
+ - Money#new uses Money.default_currency if currency arg is nil (GH-410)
335
+ - Fixed formatting of NOK, putting the symbol after numbers
336
+ - Fixed issue where rounded_infinite_precision formatting fails for some localized currencies (GH-422)
337
+
338
+ ## 6.1.1
339
+ - Remove lingering Monetize call
340
+
341
+ ## 6.1.0
342
+ - Remove deprecated methods.
343
+ - Fix issue with block form of rounding_mode.
344
+
345
+ ## 6.0.1
346
+ - Deprecated methods lists caller on print out for easier updating.
347
+ - Added support for Money::Currency#to_str and Money::Currency#to_sym
348
+ - Added ability to temporally change the rounding methond inside a given block
349
+ - Replaced parsing and core extensions with the monetize gem
350
+
351
+ ## 6.0.0
352
+ - Fix BTC subunit
353
+ - New option :sign_positive to add a + sign to positive numbers
354
+ - Only allow to multiply a money by a number (int, float)
355
+ - Fix typo
356
+ - Wrap the currency symbol in a span if :html is specified in the rules
357
+ - Added Money::Currency.all method
358
+ - Allow combined comparison operator to handle zero values without rates
359
+ - Added Money::Currency.unregister method
360
+ - Works on Ruby 1.8.7
361
+ - Update deps
362
+ - Depreciate Money.parse
363
+ - Passing symbol: false when formatting 'JPY' currency in :ja locale
364
+ will work as expected
365
+ - Divide now obeys the specified rounding mode
366
+ - Add Money#round method. This is helpful when working in infinite_precision mode and would like to perform rounding at specific points in your work flow.
367
+ - In infinite precision mode, deserialized Money objects no longer return Float values from the `fractional` method.
368
+ - Changed `thousands_separator` for Swedish Krona from dot to blank space.
369
+ - Allow mathematical operations with first argument being not an instance of Money (eg. 2 * money instead of money * 2).
370
+ - Money#dollars and Money#amount methods return numbers of type BigDecimal.
371
+ - Change Money.from_bigdecimal (and in that way .to_money too) to keep precision when using `Money.infinite_precision = true`
372
+ - Add :rounded_infinite_precision option to .format
373
+ - Changed the New Taiwan Dollar symbol position from after the amount to before the amount.
374
+ - Passing a Money instance to the Money constructor will obtain a new Money object with the same property values as the original
375
+ - Add deprecation warning to comparators
376
+ - Add Money.disallow_currency_conversion! option
377
+ - Allow to inherits from `Money`
378
+
379
+ ## 5.1.1
380
+
381
+ - Added :sign_before_symbol option to format negative numbers as -£1 rather than £-1
382
+ - Ensure BigDecimal.new always receives a string - compatibility fix for ruby-1.9.2-p320
383
+ - Update Maldivian Currency to MVR and fix ރ. to be ރ
384
+ - Add exponent to currency
385
+ - Add find_numeric to find currencies by ISO 4217 numeric code.
386
+ - Fixed regression where thousands separator was missing on certain currencies. (GH-245)
387
+ - Added :symbol_before_without_space option to add a space between currency symbol and amount.
388
+
389
+ ## 5.1.0
390
+
391
+ - Fix currency assumption when parsing $ with a non-USD default currency.
392
+ - Changed the Bulgarian lev symbol position from before the amount to after the amount.
393
+ - Changed the symbol and html entity for INR. It is now "₹" instead of "₨".
394
+ - Added Money::Currency.analyze for determining potential currencies for a given string using powereful algorithms - will detect symbols, iso codes and names even if mixed with text.
395
+ - Changed UGX symbol from 'Sh' to 'USh'.
396
+ - Changed SYP symbol from "£ or ل.س" to "£S". The previous symbols remain as alternates.
397
+ - Changed RWF symbol from 'FR' to 'FRw'.
398
+ - Changed RSD symbol from "din. or дин." to 'РСД'. The previous symbols remain as alternates.
399
+ - Added MGA symbol 'Ar'
400
+ - Added KGS symbol 'som'
401
+ - Changed KES symbol from 'Sh' to 'KSh'
402
+ - Added ETB symbol 'Br'
403
+ - Changed EGP symbol from "£ or ج.م" to "ج.م"
404
+ - Changed DJF symbol from 'Fr' to 'Fdj'
405
+ - Changed CVE symbol from '$ or Esc' to '$'. 'Esc' remains as an alternate symbol.
406
+ - Added BTN symbol 'Nu.'
407
+ - Changed BAM symbol from 'KM or КМ' to 'КМ', the alternate (cyrillic script) remains as an alternate symbol.
408
+ - Added alternate symbols for all currencies. For example, USD can be written as both '$' and 'US$', SEK can be 'Kr' or ':-', etc.
409
+ - Renamed Money#cents to Money#fractional. Money#cents can still be used as a synonym and equivalent of Money#fractional.
410
+ - Added Money.new_with_amount and Money#amount. Money.new_with_dollars and Money#dollars remain as synonyms.
411
+ - Calling Bank::Base.instance doesn't make Bank::VariableExchange.instance
412
+ return Bank::Base.instance anymore (semaperepelitsa)
413
+ - Update Turkmenistan manat from TMM to TMT currency (GH-181). [Thanks @Exoth]
414
+ - Moved ZWD Zimbabwean dollars to currency_bc.json, also added there ZWL, ZWN, and ZWR Zimbabwean dollars (GH-184).
415
+ - Switch to multi_json gem (GH-170)
416
+ - Fix "warning: ambiguous first argument..." (GH-166)
417
+ - Update dependencies to latest and greatest (GH-172)
418
+ - TravisBot is now watching Pull Request!!! (GH-171)
419
+ - Minor code cleaning
420
+ - Remove subunit from South Korean won (KRW)
421
+ - Fixed bug where bankers rounding wasn't being used everywhere.
422
+
423
+ ## 5.0.0
424
+
425
+ - Minor bugfix - incorrect use of character range resulted in
426
+ botched results for Money::Parsing#extract_cents (GH-162)
427
+ - Money::Currency::TABLE removed. Use Money::Currency.register to add
428
+ additional currencies (GH-143)
429
+ - Fix rounding error in Numeric.to_money (GH-145)
430
+ - Allow on-the-fly calculation of decimal places if not known already
431
+ (GH-146,GH-147,GH-148)
432
+ - Move Euro symbol ahead of amount (GH-151)
433
+ - Changed settings for Polish currency (GH-152)
434
+ - Fall back to symbol if there is no html_entity present (GH-153)
435
+ - Optionally Allow parsing of money values prefixed by symbols in key
436
+ currencies (GH-155)
437
+ - Fix bug where rates exported to a file from VariableExchange leave the File
438
+ object open (GH-154)
439
+ - Added Money#positive? and Money#negative? methods (GH-157)
440
+ - Fix format function output for custom currencies (GH-156)
441
+ - Fix parsing of strings with 3 decimal digits (GH-158)
442
+ - Updated development dependencies
443
+ - Said goodbye to RubyForge
444
+
445
+ ## 4.0.2
446
+
447
+ - Money.to_money now understands a currency option (GH-121)
448
+ - Added Money#-@ method to change object polarity (GH-122)
449
+ - Added Money#symbol_or_iso_code utility method (GH-128)
450
+ - Money.parse now understands trailing - as negative inputs (GH-133)
451
+ - Money::Currency.new now validates input to avoid memory leaks (GH-137)
452
+
453
+ - Forced UTF-8 encoding on currency JSON (GH-117)
454
+ - Fixed position of Philippine peso sign (GH-124)
455
+ - Fixed position of Danish currency sign (GH-127)
456
+
457
+ ## 4.0.1
458
+
459
+ - Add missing config dir.
460
+
461
+ Money 4.0.0
462
+ ===========
463
+
464
+ The big change this release is moving the currency information into a JSON
465
+ file. This should make it easier for users to add and test things. Thanks to
466
+ Steve Morris for working on this during his Mendicant University course.
467
+
468
+ In addition to this big change there were well over a dozen other minor
469
+ changes.
470
+
471
+ Features
472
+ --------
473
+ - a new exchange bank nordea has been added to the README. (k33l0r)
474
+ - a new exchange bank nbrb_currency has been added to the README. (slbug)
475
+ - update Rake tasks
476
+ - See our CI status in the README
477
+ - Add syntax highlighting to the README (phlipper)
478
+ - Remove minor unit from YEN (pwim)
479
+ - Format YEN (pwim)
480
+ - Update README for `_as_string` (mjankowski)
481
+ - Update Lebanon currency (kaleemullah)
482
+ - Update Polish złoty (holek)
483
+ - Move currency information into JSON storage! (stevemorris)
484
+ - Add ISO4217 Numeric codes (alovak)
485
+
486
+ Bugfixes
487
+ --------
488
+ - EEK currency is no longer used, kept for BC ([#issue/110](https://github.com/RubyMoney/money/issues/110))
489
+ - Lithuanian Litas symbol position fixed (laurynas)
490
+ - Fixed README typos (phlipper)
491
+ - Fixed README typos (pwim)
492
+ - Fix specs (alovak)
493
+
494
+ Money 3.7.1
495
+ ===========
496
+
497
+ Bugfixes
498
+ --------
499
+ - Add encoding indicator to top of Gemspec
500
+
501
+ Money 3.7.0
502
+ ===========
503
+
504
+ Features
505
+ --------
506
+ - add Money#to_d (thanks Andrew White)
507
+ - Add Money.use_i18n, this allows you to enable/disable i18n from being used,
508
+ even if it's required in your app.
509
+
510
+ Money 3.6.2
511
+ ===========
512
+
513
+ Features
514
+ --------
515
+ - i18n enhancements (thanks eloyesp [link](https://github.com/RubyMoney/money/commit/b2cab76c78ae04f40251fa20c4ab18faa968dc53))
516
+ - README updates (thanks pconnor)
517
+ - Break into modules
518
+ - Added `:no_cents_if_whole` format option
519
+ - Update HKD from Ho to Cent
520
+ - Performance improvements (thanks weppos)
521
+ - Added Symbol#to_currency
522
+ - Added Gemfile for development
523
+ - Updated HUF currency to use `symbol_first => false`
524
+ - Updated "Turkish New Lira" to "Turkish Lira"
525
+
526
+ Money 3.6.1
527
+ ===========
528
+
529
+ Bugfixes
530
+ --------
531
+ - Floating point comparison needs to Epsilon aware (thanks Tobias Luetke)
532
+ - reimplement fix for #issue/43, enable Marshal.(load/dump)
533
+
534
+ Money 3.6.0
535
+ ===========
536
+
537
+ Features
538
+ --------
539
+ - Add a symbol position option for Money#format (thanks Romain, Gil and
540
+ Julien)
541
+ - Updated CNY to use "Fen" and subunit_to_unit of 100
542
+ - Updates to work with gem-testers.org
543
+
544
+ Bugfixes
545
+ --------
546
+ - Fixed issue with #format(no_cents: true) (thanks Romain & Julien)
547
+
548
+ Money 3.5.5
549
+ ===========
550
+
551
+ Features
552
+ --------
553
+ - Enhancements to Money::Currency (thanks Matthew McEachen)
554
+ - Replace delimiter with thousands_separator
555
+ - Replace separator with decimal_mark
556
+ - Added symbol_first and html_entity
557
+ - Added allocation algorithm for fair(ish) splitting of money between parties
558
+ without losing pennies (thanks Tobias Luetke)
559
+
560
+ Bugfixes
561
+ --------
562
+ - Always store cents as an Integer (thanks Abhay Kumar)
563
+ - Fixed TypeError in rate exchange (thanks Christian Billen)
564
+ - Cleanup #parse (thanks Tom Lianza)
565
+
566
+ Money 3.5.4
567
+ ===========
568
+
569
+ Features
570
+ --------
571
+ - Added Currency#decimal_places.
572
+
573
+ Bugfixes
574
+ --------
575
+ - Fixed error with Money#to_s error with negative amounts that are only cents.
576
+
577
+ Money 3.5.3
578
+ ===========
579
+
580
+ Bugfixes
581
+ --------
582
+ - Fixed an error in #to_s when cents is negative
583
+
584
+ Money 3.5.2
585
+ ===========
586
+
587
+ Bugfixes
588
+ --------
589
+ - Fixed an error in #to_s which appended extra 0s incorrectly
590
+
591
+ Money 3.5.1
592
+ ===========
593
+
594
+ Bugfixes
595
+ --------
596
+ - Removed erroneous require.
597
+
598
+ Money 3.5.0
599
+ ===========
600
+
601
+ Features
602
+ --------
603
+ - Updated to RSpec2.
604
+ - Use i18n to lookup separator and delimiter signs.
605
+ - Removed all deprecated methods up to v3.5.0, including the following:
606
+ - Using Money#format with params instead of a Hash.
607
+ - Using a Hash with Money#new.
608
+ - Using Bank#exchange, use Bank#exchange_with instead.
609
+
610
+ Bugfixes
611
+ --------
612
+ - Updated Money#to_s to respect :separator and :subunit_to_unit.
613
+ - Fixed Money#format for :subunit_to_unit != 100.
614
+ ([#issue/37](https://github.com/RubyMoney/money/issues/37))
615
+ - Fixed String#to_money for :subunit_to_unit != 100.
616
+ ([#issue/36](https://github.com/RubyMoney/money/issues/36))
617
+ - Removed duplicate currencies.
618
+ ([#issue/38](https://github.com/RubyMoney/money/issues/38))
619
+ - Fixed issue related to JRuby returning 2 for Math.log10(1000).floor instead
620
+ of correctly returning 3.
621
+
622
+ Money 3.1.5
623
+ ===========
624
+
625
+ Features
626
+ --------
627
+ - Added support for creating objects with the main monetary unit instead of
628
+ cents.
629
+ ([#issue/25](https://github.com/RubyMoney/money/issues/25))
630
+ - Deprecated `Money#format` with separate params instead of Hash. Deprecation
631
+ target set to Money 3.5.0.
632
+ ([#issue/31](https://github.com/RubyMoney/money/issues/31))
633
+ - Deprecated `Money#new(0, currency: "EUR")` in favor of
634
+ `Money#new(0, "EUR")`. Deprecation target set to Money 3.5.0.
635
+ ([#issue/31](https://github.com/RubyMoney/money/issues/31))
636
+ - Throw ArgumentError when trying to multiply two Money objects together.
637
+ ([#issue/29](https://github.com/RubyMoney/money/issues/29))
638
+ - Update Money#parse to use :subunit_to_unit
639
+ ([#issue/30](https://github.com/RubyMoney/money/issues/30))
640
+
641
+ Bugfixes
642
+ --------
643
+ - Downgraded required_rubygems_version to >= 1.3.6.
644
+ ([#issue/26](https://github.com/RubyMoney/money/issues/26))
645
+ - Use BigDecimal when floating point calculations are needed.
646
+ - Ruby 1.9.2 compatibility enhancements.
647
+
648
+ Money 3.1.0
649
+ ===========
650
+
651
+ Features
652
+ --------
653
+ - Implemented `Money::Bank::Base`.
654
+ ([#issue/14](https://github.com/RubyMoney/money/issues/14))
655
+ - Added `Money::Bank::Base#exchange_with`.
656
+ - Deprecated `Money::Bank::Base#exchange`. Deprecation target set to Money
657
+ 3.2.0.
658
+ - Implemented `Money::Bank::VariableExchange`
659
+ - Deprecated `Money::VariableExchangeBank`. Deprecation target set to Money
660
+ 3.2.0.
661
+ - Deprecate `Money::SYMBOLS`, `Money::SEPARATORS` and `Money::DELIMITERS`.
662
+ Deprecation target set to Money 3.2.0.
663
+ ([#issue/16](https://github.com/RubyMoney/money/issues/16))
664
+ - Implemented `#has` for `Money` and `Money::Currency`.
665
+ - Refactored test suite to conform to RSpec conventions.
666
+ - Moved project from [FooBarWidget](https://github.com/FooBarWidget) to
667
+ [RubyMoney](https://github.com/RubyMoney)
668
+ - Added Simone Carletti to list of authors.
669
+ - Moved `@rounding_method` from `Money::Bank::VariableExchange` to
670
+ `Money::Bank::Base`.
671
+ ([#issue/18](https://github.com/RubyMoney/money/issues/18))
672
+ - Added `#setup` to `Money::Bank::Base`. Called from `#initialize`.
673
+ ([#issue/19](https://github.com/RubyMoney/money/issues/19))
674
+ - Added [google_currency](https://github.com/RubyMoney/google_currency) to list
675
+ of Currency Exchange Implementations.
676
+ - Added `#export_rates` to `Money::Bank::VariableExchange`.
677
+ ([#issue/21](https://github.com/RubyMoney/money/issues/21))
678
+ - Added `#import_rates` to `Money::Bank::VariableExchange`.
679
+ ([#issue/21](https://github.com/RubyMoney/money/issues/21))
680
+ - Removed dependency on Jeweler.
681
+ - Replaced usage of hanna with yardoc.
682
+ - Rewrote/reformatted all documentation.
683
+
684
+ Bugfixes
685
+ --------
686
+ - Fixed incorrect URLs in documentation.
687
+ ([#issue/17](https://github.com/RubyMoney/money/issues/17))
688
+ - Updated `:subunit_to_unit` for HKD from 10 to 100.
689
+ ([#issue/20](https://github.com/RubyMoney/money/issues/20))
690
+ - Updated Ghanaian Cedi to use correct ISO Code, GHS.
691
+ ([#issue/22](https://github.com/RubyMoney/money/issues/22))
692
+ - Make `default` rake task call `spec`.
693
+ ([#issue/23](https://github.com/RubyMoney/money/issues/23))
694
+
695
+ Money 3.1.0.pre3
696
+ ================
697
+
698
+ Features
699
+ --------
700
+ - Added [google_currency](https://github.com/RubyMoney/google_currency) to list
701
+ of Currency Exchange Implementations.
702
+ - Added `#export_rates` to `Money::Bank::VariableExchange`.
703
+ ([#issue/21](https://github.com/RubyMoney/money/issues/21))
704
+ - Added `#import_rates` to `Money::Bank::VariableExchange`.
705
+ ([#issue/21](https://github.com/RubyMoney/money/issues/21))
706
+
707
+ Bugfixes
708
+ --------
709
+ - Updated `:subunit_to_unit` for HKD from 10 to 100.
710
+ ([#issue/20](https://github.com/RubyMoney/money/issues/20))
711
+
712
+ Money 3.1.0.pre2
713
+ ================
714
+
715
+ Features
716
+ --------
717
+ - Moved `@rounding_method` from `Money::Bank::VariableExchange` to
718
+ `Money::Bank::Base`.
719
+ ([#issue/18](https://github.com/RubyMoney/money/issues/18))
720
+ - Added `#setup` to `Money::Bank::Base`. Called from `#initialize`.
721
+ ([#issue/19](https://github.com/RubyMoney/money/issues/19))
722
+
723
+ Bugfixes
724
+ --------
725
+ - Fixed incorrect URLs in documentation.
726
+ ([#issue/17](https://github.com/RubyMoney/money/issues/17))
727
+
728
+ Money 3.1.0.pre1
729
+ ================
730
+
731
+ Features
732
+ --------
733
+ - Implemented `Money::Bank::Base`.
734
+ ([#issue/14](https://github.com/RubyMoney/money/issues/14))
735
+ - Added `Money::Bank::Base#exchange_with`.
736
+ - Deprecated `Money::Bank::Base#exchange`. Deprecation target set to Money
737
+ 3.2.0.
738
+ - Implemented `Money::Bank::VariableExchange`
739
+ - Deprecated `Money::VariableExchangeBank`. Deprecation target set to Money
740
+ 3.2.0.
741
+ - Deprecate `Money::SYMBOLS`, `Money::SEPARATORS` and `Money::DELIMITERS`.
742
+ Deprecation target set to Money 3.2.0.
743
+ ([#issue/16](https://github.com/RubyMoney/money/issues/16))
744
+ - Implemented `#has` for `Money` and `Money::Currency`.
745
+ - Refactored test suite to conform to RSpec conventions.
746
+ - Moved project from [FooBarWidget](https://github.com/FooBarWidget) to
747
+ [RubyMoney](https://github.com/RubyMoney)
748
+ - Added Simone Carletti to list of authors.
749
+
750
+ Bugfixes
751
+ --------
752
+ - Fixed rounding error in `Numeric#to_money`.
753
+ ([#issue/15](https://github.com/RubyMoney/money/issues/15))
754
+
755
+ Money 3.0.5
756
+ ===========
757
+
758
+ Features
759
+ --------
760
+ - Added `Money#abs`.
761
+ - Added ability to pass a block to `VariableExchangeBank#new` or `#exchange`,
762
+ specifying a custom truncation method
763
+ - Added optional `currency` argument to` Numeric#to_money`.
764
+ ([#issue/11](https://github.com/RubyMoney/money/issues/11))
765
+ - Added optional `currency` argument to `String#to_money`.
766
+ ([#issue/11](https://github.com/RubyMoney/money/issues/11))
767
+ - Use '¤' as the default currency symbol.
768
+ ([#issue/10](https://github.com/RubyMoney/money/issues/10))
769
+
770
+ Bugfixes
771
+ --------
772
+ - Updated `Currency#subunit_to_unit` documentation (it's an integer not a
773
+ string).
774
+ - Fixed issue when exchanging currencies with different `:subunit_to_unit`
775
+ values.
776
+ - `Numeric#to_money` now respects `:subunit_to_unit`.
777
+ ([#issue/12](https://github.com/RubyMoney/money/issues/12))
778
+
779
+ Money 3.0.4
780
+ ===========
781
+
782
+ Features
783
+ --------
784
+ - Use `:subunit_to_unit` in `#to_s`, `#to_f` and `#format`.
785
+ - Deprecated `Money#SEPARATORS` and `Money#DELIMITERS`.
786
+
787
+ Bugfixes
788
+ --------
789
+ - Updated `#exchange` to avoid floating point rounding errors.
790
+ - Added `:separator` and `:delimiter` to `Currency`
791
+ - Updated the attributes of the Chilean Peso.
792
+
793
+ Money 3.0.3
794
+ ===========
795
+
796
+ Features
797
+ --------
798
+ - Added `#currency_as_string` and `#currency_as_string=` for easier
799
+ integration with ActiveRecord/Rails
800
+
801
+ Money 3.0.2
802
+ ===========
803
+
804
+ Features
805
+ --------
806
+ - Added `#div`, `#divmod`, `#modulo`, `#%` and `#remainder` to `Money`.
807
+
808
+ Money 3.0.1
809
+ ===========
810
+
811
+ Features
812
+ --------
813
+ - Added `#eql?` to `Money`
814
+ - Updated `Numeric#to_money` to work with all children of `Numeric` (i.e.
815
+ `BigDecimal`, `Integer`, `Fixnum`, `Float`, etc)
816
+
817
+ Money 3.0.0
818
+ ===========
819
+
820
+ Features
821
+ --------
822
+ - Version Bump due to compatibility changes with ActiveRecord. See
823
+ conversation
824
+ [here](https://github.com/RubyMoney/money/issues/4#issuecomment-224880)
825
+ for more information.
826
+
827
+ Money 2.3.0
828
+ ===========
829
+
830
+ Features
831
+ --------
832
+ - Currency is now represented by a `Currency` Object instead of a `String`.
833
+
834
+ Money 2.2.0
835
+ ===========
836
+
837
+ Features
838
+ --------
839
+ - Can now divide two Money objects by one another using `#/`.
840
+ - Can now convert a Money object to a float using `#to_f`.
841
+ - Users can now specify Separators and Delimiters when using `#format`.
842
+ - Support for Brazilian Real `Money.new(1_00, :BRL)`
843
+ - Migrated to Jeweler