Comments (5)
A Money implementation I have in Ruby actually does the following:
Money.new(10) / 2
# => [#<Money $5.00>, #<Money $5.00>]
While that initially seemed weird to me, it actually makes sense with how money is used.
Money.new(11) / 3
# => [#<Money $3.67>, #<Money $3.67>, #<Money $3.66>]
from money.
Does it make any sense to multiply or divide a Money with a Money?
I think it doesn't... 👍
About the list as return value
the other way is using upper and lower bound... doesn't look weird to me (your idea I mean).
I think we should add also percentage with this notation, what do you think?
from money.
Can you elaborate on "upper and lower bound"
Percentage is also a good idea. That would be useful for tax calculations. Any ideas on the interface?
from money.
the other way was to pass options like:
round-up that rounds the money to the smallest integer greater than or equal to num
round-down that rounds the money to the largest integer less than or equal to num
but we could go with your idea... and let's think about it later...
from money.
implemented by #22
from money.
Related Issues (20)
- Parsing with Float HOT 3
- Incorrect currency Symbols
- Parsing string HOT 1
- Question - Change decimal precision HOT 2
- Incorrect currency symbol HOT 4
- Protocol Undefined Error when rendering the amount on a Form HOT 2
- Breaking change between 1.11 and 1.12 HOT 3
- Money.parse return :error HOT 1
- Add support for value of money to cast when field type is `Money.Ecto.Map.Type`
- Question - Is there a specific reason Money.divide is not called Money.split?
- Fortnite
- KFCMULLBANK | Linktree HOT 1
- Need do get fortnite fot my kid hes good HOT 1
- Unable to parse string HOT 8
- `exponent` is required (but not enforced) when calling `Money.to_string/1` on custom currency
- Extracting value from changeset to display number only in input
- Money.parse doesn't handle scientific notation
- `Money.to_string(Money.new(75000000, :UGX))` is converting to million instead of thousand HOT 1
- Ecto aggregate functions sometimes return Decimal. HOT 1
- I can't sum total amount of transactions in `Money` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from money.