diff --git a/src/index.php b/src/index.php
index cd4ccb7..4b0237f 100644
--- a/src/index.php
+++ b/src/index.php
@@ -61,17 +61,26 @@
}
// then get the amount of icons
- preg_match_all('/\d+/', $iconNumbers, $matches);
+ preg_match_all('/([0-9]*[.])?[0-9]+/', $iconNumbers, $matches);
$numbers = $matches[0];
$min = $numbers[0];
$max = $numbers[1];
if ($iconNumbers === '100-100') {
echo " 100%";
- } elseif ($min !== $max) {
-
} else {
- // print icon image for each point
- for ($i = 1; $i <= $min; $i++) {
+ // print icon image for each point up to the rounded min
+ $roundedMin = ceil($min);
+ $roundedRemainingIcons = floor($max - $min);
+ for ($i = 1; $i <= $roundedMin; $i++) {
+ echo "";
+ }
+ // TODO: - Handle conditional icons/effects
+ if(!($max - $min > 0)) {
+ return;
+ }
+ // for each icon afterwards, if any, print it with a + separator
+ echo " + ";
+ for($i = 1; $i <= $roundedRemainingIcons; $i++) {
echo "";
}
}