[Solved] When I round x in python it returns 0.0 [closed]
It will round to 0 if x is smaller then 0.005. x = 0.005 round(x, 2) > 0.01 x = 0.0049 round(x, 2) > 0.00 1 solved When I round x in python it returns 0.0 [closed]
It will round to 0 if x is smaller then 0.005. x = 0.005 round(x, 2) > 0.01 x = 0.0049 round(x, 2) > 0.00 1 solved When I round x in python it returns 0.0 [closed]
First check datatypes: SELECT ‘0.458441’, system_type_name FROM sys.dm_exec_describe_first_result_set(N’SELECT 0.458441′, NULL, 0) UNION ALL SELECT ‘10.000000’, system_type_name FROM sys.dm_exec_describe_first_result_set(N’SELECT 10.000000′, NULL, 0) UNION ALL SELECT ‘5.000000’, system_type_name FROM sys.dm_exec_describe_first_result_set(N’SELECT 5.000000′, NULL, 0); ╔═══════════╦══════════════════╗ ║ value ║ system_type_name ║ ╠═══════════╬══════════════════╣ ║ 0.458441 ║ numeric(6,6) ║ ║ 10.000000 ║ numeric(8,6) ║ ║ 5.000000 ║ numeric(7,6) ║ ╚═══════════╩══════════════════╝ Query … Read more