diff --git a/Handler/Shared.hs b/Handler/Shared.hs index ef745ce..a145e66 100644 --- a/Handler/Shared.hs +++ b/Handler/Shared.hs @@ -338,8 +338,11 @@ testComparator (Entity _ a) (Entity _ b) = ((fromMaybe unknownPriority $ testPriority b) `compare` (fromMaybe unknownPriority $ testPriority a)) where unknownPriority = 9999 +formatNonScientifically :: Double -> Text +formatNonScientifically = T.pack . (printf "%f") + formatFullScore :: Maybe Evaluation -> Text -formatFullScore (Just evaluation) = fromMaybe "???" (T.pack <$> show <$> evaluationScore evaluation) +formatFullScore (Just evaluation) = fromMaybe "???" (formatNonScientifically <$> evaluationScore evaluation) formatFullScore Nothing = "N/A" formatTruncatedScore :: Maybe Int -> Maybe Evaluation -> Text diff --git a/Handler/ShowChallenge.hs b/Handler/ShowChallenge.hs index 2ad8ae5..1006532 100644 --- a/Handler/ShowChallenge.hs +++ b/Handler/ShowChallenge.hs @@ -419,7 +419,7 @@ checkOrInsertEvaluation repoDir chan out = do maybeEvaluation <- runDB $ getBy $ UniqueEvaluationTestChecksum (outTest out) (outChecksum out) case maybeEvaluation of Just (Entity _ evaluation) -> do - msg chan $ concat ["Already evaluated with score ", (T.pack $ fromMaybe "???" $ show <$> evaluationScore evaluation)] + msg chan $ concat ["Already evaluated with score ", (fromMaybe "???" $ formatNonScientifically <$> evaluationScore evaluation)] Nothing -> do msg chan $ "Start evaluation..." challengeDir <- getRepoDir $ challengePrivateRepo challenge @@ -429,7 +429,7 @@ checkOrInsertEvaluation repoDir chan out = do Right (Left _) -> do err chan "Cannot parse options, check the challenge repo" Right (Right (_, Just [(_, [result])])) -> do - msg chan $ concat [ "Evaluated! Score ", (T.pack $ show result) ] + msg chan $ concat [ "Evaluated! Score ", (formatNonScientifically result) ] time <- liftIO getCurrentTime _ <- runDB $ insert $ Evaluation { evaluationTest=outTest out,