determine_decimal_places_from_step Function

public function determine_decimal_places_from_step(step) result(decimal_places)

Decimal places needed to render the step exactly, matching matplotlib's ScalarFormatter. A step of 2.5 needs 1 decimal ("2.5"), 0.25 needs 2 ("0.25"); rounding to fewer would mislabel a tick (e.g. 2.5 -> "3"). The count is the fractional-digit depth of the step, not a function of its magnitude.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: step

Return Value integer