Round time value to the given precision. @param IN/OUT ltime The value to round. @param dec Precision. @return False on success, true on error. */
| 1369 | @return False on success, true on error. |
| 1370 | */ |
| 1371 | bool my_time_round(MYSQL_TIME *ltime, uint dec) |
| 1372 | { |
| 1373 | int warnings= 0; |
| 1374 | DBUG_ASSERT(dec <= DATETIME_MAX_DECIMALS); |
| 1375 | /* Add half away from zero */ |
| 1376 | bool rc= time_add_nanoseconds_with_round(ltime, |
| 1377 | msec_round_add[dec], &warnings); |
| 1378 | /* Truncate non-significant digits */ |
| 1379 | my_time_trunc(ltime, dec); |
| 1380 | return rc; |
| 1381 | } |
| 1382 | |
| 1383 | |
| 1384 | /** |
no test coverage detected