GLib.ascii_dtostr

function ascii_dtostr(buffer: String, buf_len: Number(gint), d: Number(gdouble)): String {
    // Gjs wrapper for g_ascii_dtostr()
}
  

Converts a #gdouble to a string, using the '.' as decimal point.

This function generates enough precision that converting the string back using GLib.ascii_strtod gives the same machine-number (on machines with IEEE compatible 64bit doubles). It is guaranteed that the size of the resulting string will never be larger than @G_ASCII_DTOSTR_BUF_SIZE bytes.

buffer

A buffer to place the resulting string in

buf_len

The length of the buffer.

d

The #gdouble to convert

Returns

The pointer to the buffer with the converted string.