Round real column to specified number of decimal places
@param[in,out] df The data frame instance @param[in] col_index Index of the column @param[in] decimals Number of decimal places
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(data_frame), | intent(inout) | :: | df | |||
integer, | intent(in) | :: | col_index | |||
integer, | intent(in) | :: | decimals |
subroutine df_round_column(df, col_index, decimals) type(data_frame), intent(inout) :: df integer, intent(in) :: col_index integer, intent(in) :: decimals real(rk), dimension(:), allocatable :: col real(rk) :: multiplier integer :: i col = df_get_col_real(df, col_index) multiplier = 10.0_rk**decimals do i = 1, size(col) col(i) = nint(col(i) * multiplier) / multiplier end do call df_set_col_real(df, col_index, col) end subroutine df_round_column