factor/extra/taxes/usa/fica/fica.factor

18 lines
450 B
Factor
Raw Normal View History

2008-09-30 13:47:46 -04:00
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
2008-12-18 00:36:13 -05:00
USING: accessors math math.order money kernel assocs ;
2008-09-30 13:47:46 -04:00
IN: taxes.usa.fica
: fica-tax-rate ( -- x ) DECIMAL: .062 ; inline
2008-12-18 00:36:13 -05:00
ERROR: fica-base-unknown ;
2008-09-30 13:47:46 -04:00
: fica-base-rate ( year -- x )
H{
{ 2008 102000 }
{ 2007 97500 }
2008-12-18 00:36:13 -05:00
} at [ fica-base-unknown ] unless* ;
2008-09-30 13:47:46 -04:00
: fica-tax ( salary w4 -- x )
year>> fica-base-rate min fica-tax-rate * ;