Giter Club home page Giter Club logo

Comments (5)

andrewtimberlake avatar andrewtimberlake commented on August 26, 2024

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.

liuggio avatar liuggio commented on August 26, 2024

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.

andrewtimberlake avatar andrewtimberlake commented on August 26, 2024

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.

liuggio avatar liuggio commented on August 26, 2024

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.

liuggio avatar liuggio commented on August 26, 2024

implemented by #22

from money.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.