bar scale depending on screen size, fix rounding error, reformat to
match ruby style guide