GLib.ascii_formatd

function ascii_formatd(buffer: String, buf_len: Number(gint), format: String, d: Number(gdouble)): String {
    // Gjs wrapper for g_ascii_formatd()
}
  

Converts a #gdouble to a string, using the '.' as decimal point. To format the number you pass in a printf()-style format string. Allowed conversion specifiers are 'e', 'E', 'f', 'F', 'g' and 'G'.

If you just want to want to serialize the value into a string, use GLib.ascii_dtostr.

buffer

A buffer to place the resulting string in

buf_len

The length of the buffer.

format

The printf()-style format to use for the code to use for converting.

d

The #gdouble to convert

Returns

The pointer to the buffer with the converted string.