package core_kernel

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Utility functions for parsing and outputing strings containing known numbers of digits. Used primarily for building functions for reading in and writing out Time related values.

val char_of_digit : Base.Int.t -> Char.t
val blit_string_of_int_4_digits : Base.String.t -> pos:Base.Int.t -> Base.Int.t -> Base.Unit.t

blit_string_of_int_4_digits s ~pos i blits the string representation of i into s at pos. Raises unless 0 <= i <= 9999 and there is sufficient room.

val blit_string_of_int_3_digits : Base.String.t -> pos:Base.Int.t -> Base.Int.t -> Base.Unit.t

blit_string_of_int_3_digits s ~pos i blits the string representation of i into s at pos. Raises unless 0 <= i <= 999 and there is sufficient room.

val blit_string_of_int_2_digits : Base.String.t -> pos:Base.Int.t -> Base.Int.t -> Base.Unit.t

blit_string_of_int_2_digits s ~pos i blits the string representation of i into s at pos. Raises unless 0 <= i <= 99 and there is sufficient room.

val parse_two_digits : Base.String.t -> Base.Int.t -> Base.Int.t

parse_two_digits s pos parse two digits at pos in s into the corresponding int.

val parse_four_digits : Base.String.t -> Base.Int.t -> Base.Int.t

parse_four_digits s pos parse four digits at pos in s into the corresponding int.

OCaml

Innovation. Community. Security.