STM32 core 3.0.1-dev
Arduino core for STM32 based boards: API reference
← STM32duino documentation
Loading...
Searching...
No Matches
dtostrf.c File Reference

Emulation of the avr-libc dtostrf() function. More...

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>

Functions

char * dtostrf (double val, signed char width, unsigned char prec, char *sout)
 Convert a double to a string with a fixed number of decimal places.
 

Detailed Description

Emulation of the avr-libc dtostrf() function.

Function Documentation

◆ dtostrf()

char * dtostrf ( double  val,
signed char  width,
unsigned char  prec,
char *  sout 
)

Convert a double to a string with a fixed number of decimal places.

Emulation of the avr-libc dtostrf() function.

Parameters
valValue to convert.
widthMinimum field width of the output string. Negative for left adjustment. Range -128 to 127.
precNumber of digits after the decimal point.
soutBuffer to write the result to. Must be large enough for the result.
Returns
Pointer to sout.