UNPKG

@adventurelabs/scout-core

Version:

Core utilities and helpers for Adventure Labs Scout applications

13 lines (12 loc) 376 B
export function formatRoleCasing(role) { return role.charAt(0).toUpperCase() + role.slice(1); } export function formatUsernameInitials(username) { if (!username) { return ""; } return username.slice(0, 2).toUpperCase(); } export function roundToXDecimals(num, decimals) { return Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals); }