diff --git a/magnivore/Lexicon.py b/magnivore/Lexicon.py
index f9fa08d..84ae7a2 100644
--- a/magnivore/Lexicon.py
+++ b/magnivore/Lexicon.py
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 import re
+from decimal import Decimal
 from functools import reduce
 
 from .Tracker import Tracker
@@ -38,7 +39,8 @@ class Lexicon:
         The factor rule multiplies the value by a factor.
         """
         value = cls._dot_reduce(rule['from'], target)
-        return value * rule['factor']
+        original_type = type(value)
+        return original_type(Decimal(value) * Decimal(rule['factor']))
 
     @classmethod
     def format(cls, rule, target):

diff --git a/tests/unit/Lexicon.py b/tests/unit/Lexicon.py
index 4f8e888..f1c85d6 100644
--- a/tests/unit/Lexicon.py
+++ b/tests/unit/Lexicon.py
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 import re
+from decimal import Decimal
 from unittest.mock import MagicMock
 
 from magnivore.Lexicon import Lexicon
@@ -48,17 +49,20 @@ def test_lexicon_transform(target):
     assert result == rule['transform'][target.temperature]
 
 
-@mark.parametrize('from_data, target', [
-    ('value', MagicMock(value=100)),
-    ('related.value', MagicMock(related=MagicMock(value=100)))
+@mark.parametrize('from_data, target, expected', [
+    ('value', MagicMock(value=100), 50),
+    ('value', MagicMock(value=Decimal(100)), Decimal(50)),
+    ('value', MagicMock(value=100.0), 50.0),
+    ('related.value', MagicMock(related=MagicMock(value=100)), 50)
 ])
-def test_lexicon_factor(from_data, target):
+def test_lexicon_factor(from_data, target, expected):
     rule = {
         'from': from_data,
         'factor': 0.5
     }
     result = Lexicon.factor(rule, target)
-    assert result == 50
+    assert result == expected
+    assert type(result) == type(expected)
 
 
 @mark.parametrize('from_data, format, expected', [

Lexicon.factor should check the type of the values
Lexicon.factor should check the values types or errors will happen
tests/unit/Lexicon.py::test_lexicon_factor[value-target0-50] tests/unit/Lexicon.py::test_lexicon_factor[value-target1-expected1] tests/unit/Lexicon.py::test_lexicon_factor[related.value-target3-50]
tests/unit/Lexicon.py::test_lexicon_basic tests/unit/Lexicon.py::test_lexicon_basic_dot tests/unit/Lexicon.py::test_lexicon_basic_dot_double tests/unit/Lexicon.py::test_lexicon_basic_null[field] tests/unit/Lexicon.py::test_lexicon_basic_null[table.field] tests/unit/Lexicon.py::test_lexicon_basic_null[table.field.nested] tests/unit/Lexicon.py::test_lexicon_transform[target0] tests/unit/Lexicon.py::test_lexicon_transform[target1] tests/unit/Lexicon.py::test_lexicon_factor[value-target2-50.0] tests/unit/Lexicon.py::test_lexicon_format[birthyear-{}-0-0-1992-0-0] tests/unit/Lexicon.py::test_lexicon_format[from_data1-{}-{}-0-1992-9-0] tests/unit/Lexicon.py::test_lexicon_format_dot[rel.birthyear-{}-0-0-1992-0-0] tests/unit/Lexicon.py::test_lexicon_format_dot[from_data1-{}-{}-0-1992-9-0] tests/unit/Lexicon.py::test_lexicon_match tests/unit/Lexicon.py::test_lexicon_match_none tests/unit/Lexicon.py::test_lexicon_match_from tests/unit/Lexicon.py::test_lexicon_match_dot tests/unit/Lexicon.py::test_lexicon_match_from_none tests/unit/Lexicon.py::test_lexicon_match_none_log tests/unit/Lexicon.py::test_lexicon_sync tests/unit/Lexicon.py::test_lexicon_sync_none tests/unit/Lexicon.py::test_lexicon_static tests/unit/Lexicon.py::test_lexicon_expression tests/unit/Lexicon.py::test_lexicon_expression_dot tests/unit/Lexicon.py::test_lexicon_expression_none