use double not float
This commit is contained in:
		
							parent
							
								
									074bcff823
								
							
						
					
					
						commit
						e70f67fb75
					
				@ -161,7 +161,7 @@ registerFromString s = do
 | 
				
			|||||||
-- This is Simon White's letter pairs algorithm from
 | 
					-- This is Simon White's letter pairs algorithm from
 | 
				
			||||||
-- http://www.catalysoft.com/articles/StrikeAMatch.html
 | 
					-- http://www.catalysoft.com/articles/StrikeAMatch.html
 | 
				
			||||||
-- with a modification for short strings.
 | 
					-- with a modification for short strings.
 | 
				
			||||||
compareStrings :: String -> String -> Float
 | 
					compareStrings :: String -> String -> Double
 | 
				
			||||||
compareStrings "" "" = 1
 | 
					compareStrings "" "" = 1
 | 
				
			||||||
compareStrings (_:[]) "" = 0
 | 
					compareStrings (_:[]) "" = 0
 | 
				
			||||||
compareStrings "" (_:[]) = 0
 | 
					compareStrings "" (_:[]) = 0
 | 
				
			||||||
@ -181,7 +181,7 @@ compareLedgerDescriptions s t = compareStrings s' t'
 | 
				
			|||||||
          t' = simplify t
 | 
					          t' = simplify t
 | 
				
			||||||
          simplify = filter (not . (`elem` "0123456789"))
 | 
					          simplify = filter (not . (`elem` "0123456789"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
transactionsSimilarTo :: Ledger -> String -> [(Float,LedgerTransaction)]
 | 
					transactionsSimilarTo :: Ledger -> String -> [(Double,LedgerTransaction)]
 | 
				
			||||||
transactionsSimilarTo l s =
 | 
					transactionsSimilarTo l s =
 | 
				
			||||||
    sortBy compareRelevanceAndRecency
 | 
					    sortBy compareRelevanceAndRecency
 | 
				
			||||||
               $ filter ((> threshold).fst)
 | 
					               $ filter ((> threshold).fst)
 | 
				
			||||||
 | 
				
			|||||||
@ -49,8 +49,8 @@ showStats _ _ l today =
 | 
				
			|||||||
             end _ = ""
 | 
					             end _ = ""
 | 
				
			||||||
             days = fromMaybe 0 $ daysInSpan span
 | 
					             days = fromMaybe 0 $ daysInSpan span
 | 
				
			||||||
             txnrate | days==0 = 0
 | 
					             txnrate | days==0 = 0
 | 
				
			||||||
                     | otherwise = fromIntegral txns / fromIntegral days :: Float
 | 
					                     | otherwise = fromIntegral txns / fromIntegral days :: Double
 | 
				
			||||||
             txns30 = length $ filter withinlast30 rawledgertransactions
 | 
					             txns30 = length $ filter withinlast30 rawledgertransactions
 | 
				
			||||||
             withinlast30 t = (d>=(addDays (-30) today) && (d<=today)) where d = ltdate t
 | 
					             withinlast30 t = (d>=(addDays (-30) today) && (d<=today)) where d = ltdate t
 | 
				
			||||||
             txnrate30 = fromIntegral txns30 / 30 :: Float
 | 
					             txnrate30 = fromIntegral txns30 / 30 :: Double
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user