Hi,
I want to use the icmppingsec item and read the response time in milliseconds. For this I use a multiplier of 1000 and "ms" as a unit.
The problem is, if the value exceeds 1000, the conversion function convert_units() in frontends/php/include/config.inc.php will rewrite this incorrectly using 1024 as a divider. For example "2000 ms" would be converted to "1.95 Kms" which is not really what you'd expect
This patch creates a special case for "ms" in convert_units, and does not apply any division. What do you think?
Actually, I think the default case of this function should use 1000 as a divider and not 1024. It's the conversion of bytes that should be a special case and not the opposite.
Regards
I want to use the icmppingsec item and read the response time in milliseconds. For this I use a multiplier of 1000 and "ms" as a unit.
The problem is, if the value exceeds 1000, the conversion function convert_units() in frontends/php/include/config.inc.php will rewrite this incorrectly using 1024 as a divider. For example "2000 ms" would be converted to "1.95 Kms" which is not really what you'd expect
This patch creates a special case for "ms" in convert_units, and does not apply any division. What do you think?
Actually, I think the default case of this function should use 1000 as a divider and not 1024. It's the conversion of bytes that should be a special case and not the opposite.
Regards
Comment