Click here to Skip to main content
15,891,372 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralConvertToReadableNumber PinPopular
Arpikusz8-Aug-12 21:57
Arpikusz8-Aug-12 21:57 
GeneralRe: ConvertToReadableNumber PinPopular
Shameel8-Aug-12 22:33
professionalShameel8-Aug-12 22:33 
GeneralRe: ConvertToReadableNumber Pin
J4amieC9-Aug-12 0:43
J4amieC9-Aug-12 0:43 
GeneralRe: ConvertToReadableNumber Pin
Brisingr Aerowing9-Aug-12 14:46
professionalBrisingr Aerowing9-Aug-12 14:46 
GeneralRe: ConvertToReadableNumber Pin
bojanh13-Aug-12 4:14
bojanh13-Aug-12 4:14 
GeneralRe: ConvertToReadableNumber Pin
Bernhard Hiller9-Aug-12 0:55
Bernhard Hiller9-Aug-12 0:55 
GeneralRe: ConvertToReadableNumber Pin
Eddy Vluggen9-Aug-12 1:06
professionalEddy Vluggen9-Aug-12 1:06 
GeneralRe: ConvertToReadableNumber Pin
Pete O'Hanlon9-Aug-12 1:47
mvePete O'Hanlon9-Aug-12 1:47 
Arpikusz wrote:
numReadable = "," + numReadable;

What happens if the culture is one that uses . instead of , for the separator? Not only is this bad code, it's lazy bad code because it's not taking localisation into account.

Also, as I look over the code, what happens if num is 3000.27? I can't see anywhere in this code that actually adds the portion after the decimal on to numReadable.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


CodeStash - Online Snippet Management | My blog | MoXAML PowerToys | Mole 2010 - debugging made easier

JokeRe: ConvertToReadableNumber Pin
dan!sh 9-Aug-12 2:04
professional dan!sh 9-Aug-12 2:04 
GeneralRe: ConvertToReadableNumber Pin
all_in_flames13-Aug-12 5:24
professionalall_in_flames13-Aug-12 5:24 
GeneralRe: ConvertToReadableNumber Pin
JeremyBob13-Aug-12 3:17
JeremyBob13-Aug-12 3:17 
GeneralRe: ConvertToReadableNumber Pin
Wenff13-Aug-12 3:27
professionalWenff13-Aug-12 3:27 
GeneralRe: ConvertToReadableNumber Pin
Sasha Laurel13-Aug-12 5:14
Sasha Laurel13-Aug-12 5:14 
GeneralSecurity - You're doing it wrong! PinPopular
Andrei Straut8-Aug-12 3:56
Andrei Straut8-Aug-12 3:56 
GeneralRe: Security - You're doing it wrong! Pin
Brisingr Aerowing8-Aug-12 15:15
professionalBrisingr Aerowing8-Aug-12 15:15 
JokeRe: Security - You're doing it wrong! Pin
Bernhard Hiller8-Aug-12 21:42
Bernhard Hiller8-Aug-12 21:42 
JokeRe: Security - You're doing it wrong! Pin
Andrei Straut8-Aug-12 23:05
Andrei Straut8-Aug-12 23:05 
GeneralRe: Security - You're doing it wrong! Pin
Bernhard Hiller9-Aug-12 0:49
Bernhard Hiller9-Aug-12 0:49 
GeneralRe: Security - You're doing it wrong! Pin
Andrei Straut9-Aug-12 1:15
Andrei Straut9-Aug-12 1:15 
GeneralRe: Security - You're doing it wrong! Pin
ekolis30-Aug-12 13:09
ekolis30-Aug-12 13:09 
GeneralRe: Security - You're doing it wrong! Pin
Brisingr Aerowing10-Aug-12 15:01
professionalBrisingr Aerowing10-Aug-12 15:01 
GeneralMicrosoft.Sharepoint.dll Pin
leppie7-Aug-12 3:22
leppie7-Aug-12 3:22 
GeneralRe: Microsoft.Sharepoint.dll Pin
PIEBALDconsult7-Aug-12 3:44
mvePIEBALDconsult7-Aug-12 3:44 
GeneralRe: Microsoft.Sharepoint.dll Pin
Kevin Drzycimski7-Aug-12 19:03
Kevin Drzycimski7-Aug-12 19:03 
GeneralRe: Microsoft.Sharepoint.dll Pin
leppie7-Aug-12 19:46
leppie7-Aug-12 19:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.