| Line | Branch | Exec | Source | 
|---|---|---|---|
| 1 | /* | ||
| 2 | ** EPITECH PROJECT, 2023 | ||
| 3 | ** my_printf | ||
| 4 | ** File description: | ||
| 5 | ** The functions for apply format to a double | ||
| 6 | */ | ||
| 7 | /** | ||
| 8 | * @file format_it_double.c | ||
| 9 | * @brief The file containing the format_it_double function | ||
| 10 | * @author Nicolas TORO | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include "myprintf.h" | ||
| 14 | |||
| 15 | 79 | void format_it_double(char *str_finale, | |
| 16 | formating_t *formating, double nb) | ||
| 17 | { | ||
| 18 | 79 | void (*format[])(char *, formating_t *, double) = | |
| 19 | {&format_moins_double, &format_plus_double, | ||
| 20 | &format_esp_double, &format_hash_double, &format_zero_double}; | ||
| 21 | |||
| 22 | 4/4✓ Branch 0 taken 7 times. ✓ Branch 1 taken 72 times. ✓ Branch 2 taken 1 times. ✓ Branch 3 taken 6 times. | 79 | if (formating->id_wd != -1 && formating->id_ft == -1) { | 
| 23 | 1 | format[2](str_finale, formating, nb); | |
| 24 | } | ||
| 25 | 2/2✓ Branch 0 taken 395 times. ✓ Branch 1 taken 79 times. | 474 | for (int i = 0; i < 5; i++) { | 
| 26 | 2/2✓ Branch 0 taken 7 times. ✓ Branch 1 taken 388 times. | 395 | if (formating->id_ft == i) { | 
| 27 | 7 | format[i](str_finale, formating, nb); | |
| 28 | } | ||
| 29 | } | ||
| 30 | 79 | return; | |
| 31 | } | ||
| 32 |