mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
15 lines
253 B
JavaScript
15 lines
253 B
JavaScript
/*
|
|
Silver amount from their money
|
|
*/
|
|
|
|
// TODO move to client
|
|
|
|
module.exports = function silver (num) {
|
|
if (num) {
|
|
let centCount = Math.floor((num - Math.floor(num)) * 100);
|
|
return `0${centCount}`.slice(-2);
|
|
} else {
|
|
return '00';
|
|
}
|
|
};
|