mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-08-02 12:16:06 -04:00
25 lines
609 B
JavaScript
25 lines
609 B
JavaScript
import numeral from "numeral";
|
|
|
|
export function useHelper() {
|
|
function toCurrency(value) {
|
|
return numeral(value).format('0,0.00');
|
|
}
|
|
|
|
function getRandomString(length = 16) {
|
|
let result = "";
|
|
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
|
|
for (let i = 0; i < length; i++) {
|
|
const randomIndex = Math.floor(Math.random() * characters.length);
|
|
|
|
result += characters.charAt(randomIndex);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
return {
|
|
toCurrency,
|
|
getRandomString,
|
|
};
|
|
} |