cub3d/libft/src/ft_ftoa.c

32 lines
1.1 KiB
C
Raw Normal View History

2023-10-25 13:56:45 +02:00
/* ************************************************************************** */
/* */
/* :::::::: */
2023-10-26 19:11:30 +02:00
/* ft_ftoa.c :+: :+: */
2023-10-25 13:56:45 +02:00
/* +:+ */
/* By: djonker <marvin@codam.nl> +#+ */
/* +#+ */
/* Created: 2021/02/02 03:46:17 by djonker #+# #+# */
2023-10-26 19:11:30 +02:00
/* Updated: 2023/10/18 16:56:28 by houtworm ######## odam.nl */
2023-10-25 13:56:45 +02:00
/* */
/* ************************************************************************** */
#include "../libft.h"
char *ft_ftoa(double n)
{
char *ti;
char *tf;
int i;
char *r;
ti = ft_itoa(n);
i = ft_ftoi(n);
r = ft_itoa(i);
tf = ft_strjoin(".", r);
free(r);
r = ft_strjoin(ti, tf);
free(ti);
free(tf);
return (r);
}