mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
shared-code-tags-gold-silver (#7056)
This commit is contained in:
committed by
Matteo Pagliazzi
parent
a29dd1a1c7
commit
2f1329254e
@@ -4,10 +4,11 @@ Silver amount from their money
|
||||
|
||||
// TODO move to client
|
||||
|
||||
module.exports = function(num) {
|
||||
module.exports = function silver (num) {
|
||||
if (num) {
|
||||
return ("0" + Math.floor((num - Math.floor(num)) * 100)).slice(-2);
|
||||
let centCount = Math.floor((num - Math.floor(num)) * 100);
|
||||
return `0${centCount}`.slice(-2);
|
||||
} else {
|
||||
return "00";
|
||||
return '00';
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user