VB.Net and Rounding Numbers

Our Web Engineer Reports:

In Javascript you round like so:
Var num = “11.925”
Num.toFixed(2) will give you 11.93

In PHP you round like so:
echo round(num, 2) will give you 11.93

In VB.NET you round like so:
Dim num as Decimal = 11.925
Math.Round(num, 2) will give you 11.92….

WTF?
All microsoft’s built in round functions do “Bankers Rounding” it rounds to the nearest even number
Math.Round(11.925, 2) = 11.92
Math.Round(11.935,2) = 11.93

WTF !?!

Why is this important? Well when you're writing a quoting system or something that integrates with oh, say an accounting package, the rounding of MONEY is imporatant and should be accurate.

Bankers Rounding eh? So this is where my money is going at the bank.

Sheesh.

Technorati Tags: , , ,

Other intersting links on this rounding technique:

This MS Blog: Fabulous Adventures in Coding

Wikipedia: The round-to-even rounding rule 

WordPress Spelling

If only it worked for me… :(

Finally, finally… The fine folks behind WordPress have added Spelling to the WYSIWYG editor. While I don't always use that, having spell check in there would certainly rock. Especially since the Spellbound plugin for Firefox seems to be dead in the water.

WordPress-Spelling.png

Seeing that it was added to the trunk I quickly grabbed the latest and it's running here and on a couple other test sites. Like I said, we live on the edge.

Too bad it doesn't work. :(

 

WordPress-Spelling2.png

 

Actually there's some bad ajax/javascript m0j0 going on… A lot of the TinyMCE stuff is broken in this build.

Technorati Tags: , , ,

Windows Live Search

More “innovation” from Microsoft. 

This time their innovation is a search page(ripped off from google) where you can search on the web, images, local, or news, (google ripoff) or rss (technorati).

You can also customize a home page (google ripoff) and check your email, sorry, hotmail only (yes, that would be google again)

They do use a lot of Ajax (ripped off from, well, everyone!) but they probably call it ajax.net.

scored against the web 2.0 standard it does very poorly

  • Uses python?  No
  • Is in public beta?  No
  • Uses inline AJAX ?  No
  • Is Shadows-aware ?  No
  • Uses the prefix “meta” or “micro”?  Yes!
  • Appears to be web 3.0 ?  Yes!
  • Refers to mash-ups ?  No
  • Mentions Less is More ?  No
  • Uses Cascading Style Sheets?  Yes!
  • Mentions startup ?  No
  • Uses Google Maps API?  No
  • Uses tags ?  No
  • Attempts to be XHTML Strict ?  Yes!
  • Has a Blogline blogroll ?  No
  • Has favicon ?  No
  • Appears to use AJAX ?  No
  • Refers to the Web 2.0 Validator’s ruleset ?  No
  • Mentions Dave Legg ?  No
  • Makes reference to Technorati ?  No
  • Appears to be built using Ruby on Rails ?  No
  • Refers to VCs ?  No
  • Refers to Flickr ?  No
  • Mentions The Long Tail ?  No
  • Links Slashdot and Digg ?  No
  • Mentions Cool Words ?  No
  • Mentions Ruby?  No
  • Mentions Nitro ?  No
  • Refers to podcasting ?  No
  • Has prototype.js ?  No
  • Creative Commons license ?  No
  • Appears to use MonoRail ?  No
  • Mentions Ruby ?  No
  • Mentions RDF and the Semantic Web?  No
  • Refers to del.icio.us ?  No
  • Use Catalyst ?  Yes!
  • Refers to web2.0validator ?  No
  • Uses Semantic Markup?  No
  • Refers to Rocketboom ?  No
  • Uses microformats ?  No
  • Actually mentions Web 2.0 ?  No
  • Appears to over-punctuate ?  No
  • References Firefox?  No
  • Validates as XHTML 1.1 ?  No
  • References isometric.sixsided.org?  No
  • Mentions 30 Second Rule and Web 2.0 ?  No
  • Uses the “blink” tag?  No
  • Appears to have Adsense ?  No

Someone wake me up when Microsoft introduces something new and/or interesting.

Gmail for your domain

GMail for your domain.

Wow, this would be a sweet thing to have. It would potentialy put a lot of little mail server companies behind the 8 ball.

Google is apparently thinking about (or about to beta) a product to let you provide their service as mail for your server/domain/service.

Nice if done properly and end sites don’t necessarily know it’s Google at fist look and can easily ban your users or prohibit them from registering with your email addresses.

Too many companies now have added gmail to the same list as yahoo, and hotmail accounts to the list of free accounts they won’t accept.

But I welcome the opportunity to shift my mail burdens of end users off to them. Provided of course I can still manage them and drop deadbeat users. The beta page shows a control panel and the same 2 gigs we’re used to. I welcome the spam filtering, etc, etc.

This is huge for some of us, but the general public won’t care.

Technorati Tags: , , , ,