From 82981d4b0d04c0d52020a209c8322fa0eed012f7 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 13 Oct 2019 12:50:44 +0200 Subject: Added precision For integral numbers, min width For strings, max len --- parse.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'parse.c') diff --git a/parse.c b/parse.c index b1d40a1..c61fb5c 100644 --- a/parse.c +++ b/parse.c @@ -67,9 +67,21 @@ t_pformat *parse_conversion(char *conversion) start++; } if (ft_isdigit(*start)) + { pformat->min_field_width = ft_atoi(start); + while (ft_isdigit(*start)) + start++; + } else pformat->min_field_width = -1; + pformat->precision = -1; + if (*start == '.') + { + start++; + pformat->precision = ft_atoi(start); + while (ft_isdigit(*start)) + start++; + } return (pformat); } -- cgit