Download script.js from adilmalik7364/putty-pack-pro-analyzer: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/adilmalik7364/putty-pack-pro-analyzer/resolve/main/script.js
- Command line
-
hf download hf://spaces/adilmalik7364/putty-pack-pro-analyzer/script.js
-
curl -L -o script.js https://huggingface.co/spaces/adilmalik7364/putty-pack-pro-analyzer/resolve/main/script.js
1.03 kB
| // Shared functions for the application | |
| // Format large numbers | |
| function formatNumber(num) { | |
| if (num >= 1000000) { | |
| return (num / 1000000).toFixed(1) + 'M'; | |
| } | |
| if (num >= 1000) { | |
| return (num / 1000).toFixed(1) + 'K'; | |
| } | |
| return num.toString(); | |
| } | |
| // Calculate potential savings | |
| function calculateSavings() { | |
| const bagsPerShift = document.getElementById('bagsInput').value; | |
| const savingPerBag = 5; // ₹5 per bag | |
| const potentialSavings = bagsPerShift * savingPerBag; | |
| document.getElementById('savingsResult').textContent = | |
| `Potential savings: ₹${potentialSavings.toLocaleString()}`; | |
| return potentialSavings; | |
| } | |
| // Initialize tooltips | |
| function initTooltips() { | |
| const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')); | |
| tooltipTriggerList.map(function (tooltipTriggerEl) { | |
| return new bootstrap.Tooltip(tooltipTriggerEl); | |
| }); | |
| } | |
| // Export functions if needed | |
| export { calculateSavings, initTooltips }; |