Posts

Showing posts with the label Formatting

Cannot Reformat Bootable Usb Drive On Windows

Image
Answer : You can use the utilities that come with Windows to do this without downloading anything else. DISKPART from the command line as Administrative user will do what you need. Once inside of the diskpart utility type in list disk , select the USB disk by typing select disk (x) and then clean , this should now wipe the USB stick, you can now create a new partition and format the UBS stick. To create a new partition table on the USB type in create partition primary , then select partition 1 , then format fs=fat32 quick . Your USB stick should now be ready to use. Use another formatting tool, Windows sucks at this part. As it seems you have partitioned this drive. Use this http://www.pendrivelinux.com/restoring-your-usb-key-partition/ After having tooled around with a USB Linux version using your image overwritten or multi partitioned flash pen drive, you might find it necessary to revert it back to a single fat partition (restore the flash pen drive to it's origin...

Chart.js Number Format

Answer : There is no built-in functionality for number formatting in Javascript. I found the easiest solution to be the addCommas function on this page. Then you just have to modify your tooltipTemplate parameter line from your Chart.defaults.global to something like this: tooltipTemplate: "<%= addCommas(value) %>" Charts.js will take care of the rest. Here's the addCommas function: function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } Put tooltips in 'option' like this: options: { tooltips: { callbacks: { label: function(tooltipItem, data) { return tooltipItem.yLabel.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); } } ...