Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of float printing in the shell. #57

Merged
merged 2 commits into from
Oct 26, 2016
Merged

Fix of float printing in the shell. #57

merged 2 commits into from
Oct 26, 2016

Conversation

gordonguthrie
Copy link
Contributor

Before:

SELECT 555, 1.1, 1e1, 1.123e-2 from GeoCheckin WHERE time > 1452252523182 AND time < 1452252543182 AND region = 'South Atlantic' AND state = 'South Carolina';

Returned

+---+--------------------------+--------------------------+--------------------------+
|555|           1.1            |           10.0           |         0.01123          |
+---+--------------------------+--------------------------+--------------------------+
|555|1.10000000000000008882e+00|1.00000000000000000000e+01|1.12300000000000003986e-02|
+---+--------------------------+--------------------------+--------------------------+

Now it returns:

+---+---+----+-------+
|555|1.1|10.0|0.01123|
+---+---+----+-------+
|555|1.1|10.0|0.01123|
+---+---+----+-------+

Before:

```
SELECT 555, 1.1, 1e1, 1.123e-2 from GeoCheckin WHERE time > 1452252523182 AND time < 1452252543182 AND region = 'South Atlantic' AND state = 'South Carolina';
```

Returned
```
+---+--------------------------+--------------------------+--------------------------+
|555|           1.1            |           10.0           |         0.01123          |
+---+--------------------------+--------------------------+--------------------------+
|555|1.10000000000000008882e+00|1.00000000000000000000e+01|1.12300000000000003986e-02|
+---+--------------------------+--------------------------+--------------------------+
```

Now it returns:
```
+---+---+----+-------+
|555|1.1|10.0|0.01123|
+---+---+----+-------+
|555|1.1|10.0|0.01123|
+---+---+----+-------+
```
@thumbot
Copy link
Contributor

thumbot commented Oct 26, 2016

Thanks @gordonguthrie!

@thumbot
Copy link
Contributor

thumbot commented Oct 26, 2016

.thumbs.yml config:

...

@hmmr
Copy link
Contributor

hmmr commented Oct 26, 2016

+1

@macintux
Copy link
Contributor

I imagine this should also include a rebar.config update for mochijson or whatever the appropriate application is.

Copy link

@hazen hazen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the mochiweb rebar dependency

@@ -82,7 +82,7 @@ split_lists_by_length(Strings, PerString, MaxLen) ->
to_list(A) when is_atom(A) -> atom_to_list(A);
to_list(B) when is_binary(B) -> binary_to_list(B);
to_list(I) when is_integer(I) -> integer_to_list(I);
to_list(F) when is_float(F) -> float_to_list(F);
to_list(F) when is_float(F) -> mochinum:digits(F);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@macintux Makes a good point. Looks like it's in mochiweb https://github.com/basho/mochiweb/blob/master/src/mochinum.erl#L45-L59

Here's the current dependency:
{mochiweb, "2.9.0.*", {git, "git://github.com/basho/mochiweb.git", {tag, "v2.9.0p2"}}}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, not really sure about the rebar.config stuff with riak-shell because clique is a dependency which is also not in rebar.config - did mean to ask about that...

@hazen
Copy link

hazen commented Oct 26, 2016

👍

@hazen hazen merged commit 90dd3a2 into develop Oct 26, 2016
@hazen hazen deleted the bug-fixes-gg branch October 26, 2016 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants