-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/challenge a shogo_takasaki #316
base: master
Are you sure you want to change the base?
Conversation
Sider has detected 1 error and 2 warnings on analyzing the commit b754f13.
If the errors persist even after retrying, the following actions may resolve them:
If you still have problems, feel free to ask us via chat. 💬 You can turn off such notifications if unnecessary. |
|
||
def price_with_tax(ampere, usage) | ||
# 有効桁数は単価表に合わせ、小数点以下2桁とする | ||
price(ampere, usage) + (price(ampere, usage) * Simulator::TAX_RATE).round(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
price
を2回算出しますか?
"additional_price": { | ||
"120": 19.88, | ||
"300": 26.48, | ||
"2000000000": 30.57 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2000000000
は上限に当てはまらないような適当な数値だと思いますが、もう少し良い書き方はないでしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jsonのkeyを各プランの上限値 -> 下限値に変更して、マスタデータをよりシンプルにメンテナンスできる様に変更しました。
615ffa3
end | ||
|
||
def price_with_tax(ampere, usage) | ||
# 有効桁数は単価表に合わせ、小数点以下2桁とする |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「電気料金」と考えると整数にする方が良いように思いました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ご指摘どおり、表示形式は整数表示にしました
7752a37
はじめまして、柏木と申します。 |
お世話になります。高崎です! |
return result unless result.nil? | ||
|
||
raise Message::NO_UNIT_PRICE | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hashからpriceを引き出すところはスッキリして良くなったと思います。
ただそもそも従量料金の計算の仕方が誤っています。どう間違っているかまではお伝えしないので、もう一度お調べできますか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
すみません、今日面談だったことを気にせず申し上げてしまいました。ご無理のない範囲でお時間があれば見てもらえるとありがたいです!
ファイル構成及び役割
plans.json
simulator.rb
plan.rb
補足事項