# Path: sitegeist/formatting.py
# TWOPLACES = Decimal("0.01")
# def dec2curr(d, whole=False):
# def dec2num(d, whole=False):
# def dec2pct(d, raw=False, whole=False):
# 
# Path: sitegeist/utils.py
# def age2ym(age):


from decimal import Decimal
from sitegeist import formatting, utils
import unittest
        self.assertEqual(s, "23.24")

        d = Decimal("23456.308")
        s = formatting.dec2num(d)
        self.assertEqual(s, "23,456.31")

        s = formatting.dec2num(d, whole=True)
        self.assertEqual(s, "23,456")

    def test_dec2curr(self):

        d = Decimal("23.8424")
        s = formatting.dec2curr(d)
        self.assertEqual(s, "$23.84")

        d = Decimal("2384.24")
        s = formatting.dec2curr(d)
        self.assertEqual(s, "$2,384.24")


class UtilsTestCase(unittest.TestCase):

    def test_age2ym(self):

        age = Decimal("31.4")
        (years, months) = utils.age2ym(age)
        self.assertEqual(years, 31)
        self.assertEqual(months, 4)

        age = Decimal("31.95")

# Path: sitegeist/formatting.py
# TWOPLACES = Decimal("0.01")
# def dec2curr(d, whole=False):
# def dec2num(d, whole=False):
# def dec2pct(d, raw=False, whole=False):
# 
# Path: sitegeist/utils.py
# def age2ym(age):


# Path: sitegeist/tests.py
from decimal import Decimal
from sitegeist import formatting, utils
import unittest

        self.assertEqual(s, "23.24")

        d = Decimal("23456.308")
        s = formatting.dec2num(d)
        self.assertEqual(s, "23,456.31")

        s = formatting.dec2num(d, whole=True)
        self.assertEqual(s, "23,456")

    def test_dec2curr(self):

        d = Decimal("23.8424")
        s = formatting.dec2curr(d)
        self.assertEqual(s, "$23.84")

        d = Decimal("2384.24")
        s = formatting.dec2curr(d)
        self.assertEqual(s, "$2,384.24")


class UtilsTestCase(unittest.TestCase):

    def test_age2ym(self):

        age = Decimal("31.4")
        (years, months) = utils.age2ym(age)
        self.assertEqual(years, 31)
        self.assertEqual(months, 4)

        age = Decimal("31.95")

        (years, months) = utils.age2ym(age)