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

Unoptimized oci_util:to_num #50

Open
c-bik opened this issue Jul 12, 2017 · 0 comments
Open

Unoptimized oci_util:to_num #50

c-bik opened this issue Jul 12, 2017 · 0 comments
Assignees

Comments

@c-bik
Copy link
Member

c-bik commented Jul 12, 2017

> dderloci_utils:oranumber_encode(<<"10.5">>).
<<3,193,11,51>> % Compact represetation
> dderloci_utils:oranumber_encode(<<"10.500">>).
<<3,193,11,51>> % Compact represetation (automatic trailing zeros removal)
> oci_util:from_num(<<3,193,11,51>>).   
"10.5"
> float_to_list(10.5, [{decimals,4}]).
"10.5000"
> oci_util:to_num(float_to_list(10.5, [{decimals,4}])).
<<4,193,11,51,1>> % Trailing zeros preserved
> oci_util:from_num(<<4,193,11,51,1>>).
"10.500"
@c-bik c-bik self-assigned this Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant