AD:
税込みの値段から、GSTの額を計算します。
GSTは10%です in 201802の時点で
1 2 3 4 5 |
require 'bigdecimal' - original_price = 265.00 - tax = 1.1 - before_tax = (BigDecimal((original_price/tax).to_s).ceil(2).to_f) - gst = (BigDecimal((original_price - before_tax).to_s).floor(2).to_f) |
AD:
No Comments, Comment or Ping
Reply to “Ruby – GST – Calculation in Australia || Rubyでオーストラリアの消費税の計算方法”
Warning: Undefined variable $user_ID in /home/sazaeau/mizoshiri.com/public_html/blog.mizoshiri.com/wp-content/themes/grid_focus_public_mizo/comments.php on line 66
You must be logged in to post a comment.