-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_printdec.c
29 lines (26 loc) · 1.08 KB
/
ft_printdec.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printdec.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: yel-aoun <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/30 19:41:39 by yel-aoun #+# #+# */
/* Updated: 2021/12/02 19:16:04 by yel-aoun ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_printdec(int d)
{
long long s;
s = d;
if (s < 0)
{
ft_printchar('-');
s *= -1;
}
if (s >= 10)
ft_printdec(s / 10);
ft_printchar((s % 10) + 48);
return (ft_cal_dec(d));
}