summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorunknown <holyfoot@deer.(none)>2005-11-03 13:49:37 +0400
committerunknown <holyfoot@deer.(none)>2005-11-03 13:49:37 +0400
commitfb832641c340e528677d8e90f419303e8ae13fd0 (patch)
tree202920c36e4c0220cee6dae6fa88b9b69b440d95 /strings/decimal.c
parentd8fa981918d0a98fb83db4733542a61312fbff6c (diff)
downloadmariadb-git-fb832641c340e528677d8e90f419303e8ae13fd0.tar.gz
Fix for bug #14268 (Bad FLOAT->DECIMAL conversion)
mysql-test/r/type_newdecimal.result: test result updated mysql-test/t/type_newdecimal.test: test case added strings/decimal.c: i think that gives the proper precision
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index ea6ac2caf38..2fff4d75449 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -973,7 +973,7 @@ int double2decimal(double from, decimal_t *to)
{
/* TODO: fix it, when we'll have dtoa */
char s[400], *end;
- sprintf(s, "%f", from);
+ sprintf(s, "%.16G", from);
end= strend(s);
return string2decimal(s, to, &end);
}