diff --git a/src/utilities/ticks/fortplot_tick_formatting.f90 b/src/utilities/ticks/fortplot_tick_formatting.f90 index 73513b77..33301c72 100644 --- a/src/utilities/ticks/fortplot_tick_formatting.f90 +++ b/src/utilities/ticks/fortplot_tick_formatting.f90 @@ -26,7 +26,7 @@ function format_tick_value(value, range) result(formatted) abs_value = abs(value) - if (abs_value < 1.0e-10_wp) then + if (abs_value <= epsilon(1.0_wp)) then formatted = '0' else if (range >= 100.0_wp .or. abs_value >= SCIENTIFIC_THRESHOLD_HIGH) then ! Use integer format for large ranges @@ -60,7 +60,7 @@ function format_tick_value_smart(value, max_chars) result(formatted) abs_value = abs(value) ! Handle zero - if (abs_value < 1.0e-10_wp) then + if (abs_value <= epsilon(1.0_wp)) then formatted = '0' return end if