-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathops_func7.c
64 lines (58 loc) · 1.57 KB
/
ops_func7.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ops_func7.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jinpark <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/23 17:11:03 by jinpark #+# #+# */
/* Updated: 2019/04/26 16:27:24 by jinpark ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *set_minuszero(char *new, char c)
{
new[0] = c;
new[1] = '0';
new[2] = '.';
new[3] = '\0';
return (new);
}
int bl_check(char *str, int n, char c)
{
int i;
int cnt;
i = n;
cnt = 0;
while (str[i++] != c)
{
if (str[i] == 'L')
cnt++;
}
return (cnt);
}
void d_print_func_bhash(char *s, t_store *a)
{
int i;
int prec;
int len;
i = -1;
if (a->prec > a->len)
prec = a->prec - a->len;
else
prec = 0;
if (a->len > a->prec)
len = a->len - a->prec;
if (a->wid != 0)
while (++i < a->wid)
ft_putchar(' ');
i = -1;
ft_putstr("0X");
if (prec != 0)
while (++i < prec)
ft_putchar('0');
i = -1;
if (len != 0)
while (++i < a->len)
ft_putchar(s[i]);
}