How to save numerical values with whole precision to a database?
3 次查看(过去 30 天)
显示 更早的评论
I need to save numerical values of type double to Postgresql 11 database using jdbc connection.
I have observed that the values that the database is saving do not have 16 digits of precision but only 15.
In the result when I upload numerical data to the database, download it and compare with the original I receive different values.
I have tried to use in the target database table types numeric, numeric(38,16) and double precision, but the result was always the same - the data were rounded to 15 digits.
I have found a workaround changing the doubles to string using num2str(value,17) saving string to the database and converting the string in the database to numeric and this solution works, but is there an easier way to do it?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!