let findMargins = (maximum: number) => { const _sign = maximum < 0 ? -1 : 1; const _maximum = Math.abs(maximum); const _multiplier = Math.pow(10, Math.floor(_maximum).toString().length - 1); return Math.ceil(_maximum / _multiplier) * _multiplier * _sign; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter