OSDN Git Service

Merge branch 'master' of ssh://www.deister.jp/mnt/hdb1/git/hayashi
[hayashilib/hayashi.git] / src / jp / co / areaweb / tools / core / Tax.java
index 10ff74c..8c9ac61 100644 (file)
@@ -1,45 +1,45 @@
-/*
- * Created on 2005/06/09
- *
- */
-package jp.co.areaweb.tools.core;
-
-/**
- * @author y_hayashi
- *
- *     消費税に関するメソッドを集めたクラス
- *     端数は四捨五入する
- */
-public abstract class Tax {
-       public static int taxRates = 5; // 消費税率。パーセンテージで示す。
-                                                                               // 税率が変更されたときにはこの値を直接変更する。
-       
-       /**
-        * 総額に対する本体の金額を求める。
-        */
-       public static long calcBody(long totalValue) {
-               return Math.round((new Long(totalValue)).doubleValue() * 100 / (100 + taxRates));
-       }
-
-       /**
-        * 総額に対する消費税額を求める。
-        */
-       public static long calcTax(long totalValue) {
-               return totalValue - calcBody(totalValue) ;
-       }
-
-
-       /**
-        * 本体価格に対する消費税額を求める。
-        */
-       public static long toTax(long bodyValue) {
-               return Math.round((new Long(bodyValue)).doubleValue() * taxRates / 100);
-       }
-
-       /**
-        * 本体価格に対する総額を求める。
-        */
-       public static long toTotal(long bodyValue) {
-               return bodyValue + toTax(bodyValue);
-       }
-}
+/*\r
+ * Created on 2005/06/09\r
+ *\r
+ */\r
+package jp.co.areaweb.tools.core;\r
+\r
+/**\r
+ * @author y_hayashi\r
+ *\r
+ *     消費税に関するメソッドを集めたクラス\r
+ *     端数は四捨五入する\r
+ */\r
+public abstract class Tax {\r
+       public static int taxRates = 5; // 消費税率。パーセンテージで示す。\r
+                                                                               // 税率が変更されたときにはこの値を直接変更する。\r
+       \r
+       /**\r
+        * 総額に対する本体の金額を求める。\r
+        */\r
+       public static long calcBody(long totalValue) {\r
+               return Math.round((new Long(totalValue)).doubleValue() * 100 / (100 + taxRates));\r
+       }\r
+\r
+       /**\r
+        * 総額に対する消費税額を求める。\r
+        */\r
+       public static long calcTax(long totalValue) {\r
+               return totalValue - calcBody(totalValue) ;\r
+       }\r
+\r
+\r
+       /**\r
+        * 本体価格に対する消費税額を求める。\r
+        */\r
+       public static long toTax(long bodyValue) {\r
+               return Math.round((new Long(bodyValue)).doubleValue() * taxRates / 100);\r
+       }\r
+\r
+       /**\r
+        * 本体価格に対する総額を求める。\r
+        */\r
+       public static long toTotal(long bodyValue) {\r
+               return bodyValue + toTax(bodyValue);\r
+       }\r
+}\r