-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app: refactoring float accounting extension
Signed-off-by: Sergey Gaychuk <[email protected]> Signed-off-by: Sergey Yanovich <[email protected]>
- Loading branch information
1 parent
b0293d5
commit 0c92ef8
Showing
7 changed files
with
58 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
# encoding: UTF-8 | ||
|
||
# Copyright (C) 2011 Sergey Yanovich <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Please see ./COPYING for details | ||
|
||
# This file is auto-generated from the current state of the database. Instead | ||
# of editing this file, please use the migrations feature of Active Record to | ||
# incrementally modify your database, and then regenerate this schema definition. | ||
|
@@ -124,5 +114,3 @@ | |
add_index "txns", ["fact_id"], :name => "index_txns_on_fact_id", :unique => true | ||
|
||
end | ||
|
||
# vim: ts=2 sts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright (C) 2011 Sergey Yanovich <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Please see ./COPYING for details | ||
|
||
require "spec_helper" | ||
|
||
describe Float do | ||
it "should add accounting methods" do | ||
#describe "#accounting_zero?" | ||
0.0.accounting_zero?.should be_true | ||
0.00009.accounting_zero?.should be_false | ||
-0.00009.accounting_zero?.should be_false | ||
-0.000071.accounting_zero?.should be_true | ||
0.000081.accounting_zero?.should be_true | ||
0.03.accounting_zero?.should be_false | ||
#describe "#accounting_round64" | ||
100.05.accounting_round64.should eq(100.0) | ||
-100.05.accounting_round64.should eq(-100.0) | ||
100.8.accounting_round64.should eq(101.0) | ||
-100.8.accounting_round64.should eq(-101.0) | ||
#describe "#accounting_norm" | ||
1.0005.accounting_norm.should eq(1.0) | ||
-1.0005.accounting_norm.should eq(-1.0) | ||
1.008.accounting_norm.should eq(1.01) | ||
-1.008.accounting_norm.should eq(-1.01) | ||
#describe "#accounting_negative?" | ||
0.0.accounting_negative?.should be_false | ||
0.00009.accounting_negative?.should be_false | ||
-0.00009.accounting_negative?.should be_true | ||
-0.000071.accounting_negative?.should be_false | ||
0.000081.accounting_negative?.should be_false | ||
0.03.accounting_negative?.should be_false | ||
-0.03.accounting_negative?.should be_true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (C) 2011 Sergey Yanovich <[email protected]> | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License as | ||
# published by the Free Software Foundation; either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# Please see ./COPYING for details | ||
|
||
require "accounting" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters