summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitsutoshiAoe <>2014-04-22 13:39:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2014-04-22 13:39:00 (GMT)
commite3e306073d3cf9af6683ccc7c7a12d663de42d8d (patch)
treec82feabc805cc8a4a2586afa390e9a16a5b90a45
parent9034f717248275df59b53d4d3234fc35b5838881 (diff)
version 0.2.1.10.2.1.1
-rw-r--r--CHANGELOG.md4
-rw-r--r--influxdb.cabal4
-rw-r--r--src/Database/InfluxDB/TH.hs2
-rw-r--r--src/Database/InfluxDB/Types.hs6
4 files changed, 11 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6731572..36d71ca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## v0.2.1.1 - 2014-04-22
+
+* Bug fix: Treat as integer if base10Exponent is positive
+
## v0.2.1 - 2014-04-22
* Add `stripPrefixSnake`
diff --git a/influxdb.cabal b/influxdb.cabal
index 48491c4..43899e8 100644
--- a/influxdb.cabal
+++ b/influxdb.cabal
@@ -1,5 +1,5 @@
name: influxdb
-version: 0.2.1
+version: 0.2.1.1
synopsis: Haskell client library for InfluxDB
description: Haskell client library for InfluxDB
homepage: https://github.com/maoe/influxdb-haskell
@@ -113,5 +113,5 @@ source-repository head
source-repository this
type: git
- tag: v0.2.1
+ tag: v0.2.1.1
location: https://github.com/maoe/influxdb-haskell.git
diff --git a/src/Database/InfluxDB/TH.hs b/src/Database/InfluxDB/TH.hs
index 840db7d..8d22a90 100644
--- a/src/Database/InfluxDB/TH.hs
+++ b/src/Database/InfluxDB/TH.hs
@@ -72,7 +72,7 @@ toSeriesDataBody opts tyName tyVars con = do
tyVarToPred tv = case tv of
PlainTV name -> classP ''FromValue [varT name]
KindedTV name _ -> classP ''FromValue [varT name]
- deriveDecs conName vars = do
+ deriveDecs _conName vars = do
a <- newName "a"
sequence
[ funD 'toSeriesColumns
diff --git a/src/Database/InfluxDB/Types.hs b/src/Database/InfluxDB/Types.hs
index c2e9cdf..bf12e1f 100644
--- a/src/Database/InfluxDB/Types.hs
+++ b/src/Database/InfluxDB/Types.hs
@@ -139,8 +139,10 @@ instance A.FromJSON Value where
where
#if MIN_VERSION_aeson(0, 7, 0)
numberToValue
- | base10Exponent n == 0 = Int $ fromIntegral $ coefficient n
- | otherwise = Float $ realToFrac n
+ | e < 0 = Float $ realToFrac n
+ | otherwise = Int $ fromIntegral $ coefficient n * 10 ^ e
+ where
+ e = base10Exponent n
#else
numberToValue = case n of
I i -> Int $ fromIntegral i