module/alsa+backlight: round() percentage values

Closes #10
This commit is contained in:
Daniel Eklöf 2020-09-24 13:55:17 +02:00
parent 85ae4cca37
commit db53cf9245
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include <unistd.h>
#include <poll.h>
@ -46,7 +47,7 @@ content(struct module *mod)
const long current = m->current_brightness;
const long max = m->max_brightness;
const long percent = max > 0 ? 100 * current / max : 0;
const long percent = max > 0 ? round(100. * current / max) : 0;
struct tag_set tags = {
.tags = (struct tag *[]){