use double not float

This commit is contained in:
Simon Michael 2009-05-29 17:46:43 +00:00
parent 074bcff823
commit e70f67fb75
2 changed files with 4 additions and 4 deletions

View File

@ -161,7 +161,7 @@ registerFromString s = do
-- This is Simon White's letter pairs algorithm from
-- http://www.catalysoft.com/articles/StrikeAMatch.html
-- with a modification for short strings.
compareStrings :: String -> String -> Float
compareStrings :: String -> String -> Double
compareStrings "" "" = 1
compareStrings (_:[]) "" = 0
compareStrings "" (_:[]) = 0
@ -181,7 +181,7 @@ compareLedgerDescriptions s t = compareStrings s' t'
t' = simplify t
simplify = filter (not . (`elem` "0123456789"))
transactionsSimilarTo :: Ledger -> String -> [(Float,LedgerTransaction)]
transactionsSimilarTo :: Ledger -> String -> [(Double,LedgerTransaction)]
transactionsSimilarTo l s =
sortBy compareRelevanceAndRecency
$ filter ((> threshold).fst)

View File

@ -49,8 +49,8 @@ showStats _ _ l today =
end _ = ""
days = fromMaybe 0 $ daysInSpan span
txnrate | days==0 = 0
| otherwise = fromIntegral txns / fromIntegral days :: Float
| otherwise = fromIntegral txns / fromIntegral days :: Double
txns30 = length $ filter withinlast30 rawledgertransactions
withinlast30 t = (d>=(addDays (-30) today) && (d<=today)) where d = ltdate t
txnrate30 = fromIntegral txns30 / 30 :: Float
txnrate30 = fromIntegral txns30 / 30 :: Double