get_bar

Function get_bar 

Source
pub fn get_bar(percent: u8) -> String
Expand description

Generates a visual bar representation of a percentage using Unicode blocks.

§Arguments

  • percent - An unsigned 8-bit integer representing the percentage (0-100) to be visualized.

§Returns

  • A String containing a visual bar representation, with filled blocks () indicating the percentage, and empty blocks () for the remainder. The total length of the bar is 14 characters, enclosed in square brackets.