Format a logical as a JSON true/false literal (as opposed to
fmt_logical’s Fortran .true./.false.).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(in) | :: | v |
pure function fmt_json_bool(v) result(str) !! Format a logical as a JSON `true`/`false` literal (as opposed to !! `fmt_logical`'s Fortran `.true.`/`.false.`). logical, intent(in) :: v character(len=:), allocatable :: str if (v) then str = "true" else str = "false" end if end function fmt_json_bool