I’m a programmer, but there are a few things I’ll admit I don’t do much of (as I have little interest in learning). Playing with numbers in scientific notation is one of them.
I was importing from a spreadsheet and needed to get “6.00234419836431E+15” to something readable.
I discovered that you need to specify a NumberStyle when you parse as a decimal, because by default you’ll get an error as it expects an ‘easy’ conversion.
The number above had decimals, exponent, the lot – so the following line of code does the job nicely…
//Globalisation namespace just shown for clarity – you’ll want to put this in a using statement 🙂
This gives you “6002344198364310”. Sweet.
Prototype (like JQuery) uses the $ notation, and so by default any GreaseMonkey User Script loaded will hijack the $ object, meaning that stuff on the original site may stop working.
I thought I was sunk but it turns out JQuery just gets better, and it can gracefully give back control of the $ to whichever library originally loaded it. Just call..
You then have to use jQuery instead of $ (e.g. jQuery(“#myID”) instead of $(“#myID”) ), but hey – that’s a small price to pay when the alternative is rewriting the whole thing long-hand.