Use string amounts for balance

Doesn't change anything in practice
This commit is contained in:
Juerd Waalboer 2022-06-12 02:17:44 +02:00
parent 0cdb1b7eba
commit 3a07b8eadb
2 changed files with 2 additions and 2 deletions

View file

@ -24,7 +24,7 @@ sub names() {
}
sub balance($username) {
return RevBank::Amount->new_from_float( _read()->{ lc $username }->[1] );
return RevBank::Amount->parse_string( _read()->{ lc $username }->[1] );
}
sub since($username) {

View file

@ -45,7 +45,7 @@ sub _recent($n, $u) {
sub balance($self, $u) {
_recent(10, $u);
printf "Balance for $u is \e[1m%+.2f\e[0m\n", RevBank::Users::balance($u);
printf "Balance for $u is \e[1m%s\e[0m\n", RevBank::Users::balance($u)->string("+");
say "NB: Products/amounts/commands FIRST, username LAST.";
return ABORT;
}