Posts Tagged ‘Google’

HowTo: round a number up to N decimal digits in Javascript

Was just trying to round-off some Google Maps coordinates for display in Javascript up to 3 decimal digits and that was a bit like a blast from the past (the end of the ‘90s to be more accurate)…

So here’s my contributed answer at:

This works for rounding to N digits (if you just want to truncate to N digits remove the Math.round call and use the Math.trunc one):

function roundN(value, digits) {
   var tenToN = 10 ** digits;
   return /*Math.trunc*/(Math.round(value * tenToN)) / tenToN;

Had to resort to such logic at Java in the past when I was authoring data manipulation E-Slate components. That is since I had found out that adding 0.1 many times to 0 you’d end up with some unexpectedly long decimal part (this is due to floating point arithmetics).

A user comment at Format number to always show 2 decimal places calls this technique scaling.

Some mention there are cases that don’t round as expected and at this is suggested instead:

function round(value, decimals) {
  return Number(Math.round(value+'e'+decimals)+'e-'+decimals);


YouTube (Google) 502 error page

Categories: Posts Tags: , , , , ,

Mistyping URL lures you into a pay-per-message scheme

A reader of my recent article on a page faking YouTube design to lure you into subscribing for a pay-per-message you receive scheme for mobile phones, told me that they came across a very similar one by typing instead of I noticed that also typing instead of takes one to exactly the same page design. Prominent is the “G” letter with a font that reminds a lot of Gmail/Google (but not of Wikipedia btw).






This time their last page seems broken, since it does ask for your phone number, but the UI to enter it is missing


Google: Χαμένοι στη μετάφραση


Τραγική η αυτόματη μετάφραση στα Ελληνικά πολλές φορές. Το Google Toolbar στην παραπάνω εικόνα έχει μεταφράσει το AD (Active Directory) σε μ.Χ. (Μετά Χριστόν) για τα χρήσιμα (για πληροφορικάριους μόνο φυσικά) εργαλεία AD Explorer και AD Insight της SysInternals (που είναι εδώ και κάμποσο καιρό πλέον μέρος της Microsoft).

Try IE9 with HTML5 showcases from Microsoft, Mozilla, Google and Apple

Since IE9 final version is being released today (, here are some HTML5 showcases from different browser makers to test it out against:

Could even try some of Google’s Chrome specific demos in case they work with IE9 too:


IE9 RC (Release Candidate) wasn’t fully HTML5 compliant last time tested mind you, but neither the other browsers were as you can see at W3C tests:

IE9 is way better though than IE8:

Can also see lots of HTML5 tests for browsers at:


BTW, it is very interesting that IE9 also supports the WOFF format (Web Open Font Format). Typeface lovers can drool freely here:


Here’s a relevant post with nice video of Mozilla’s showcase:


So should we start drooling on future WebGL support in the browsers’ world too now?

(see video at that post and find more WebGL apps at

Bug: Google Maps rendering exotic place names onto Patras, Greece


Seems that day (8 Aug 2010), Google Maps system had been drinking or something, else I can’t explain how “Cara Oasis” and other exotic place names (in Arabic script?) were rendered onto a map for the outskirts of Patras, Greece.

Categories: Posts Tags: , , , ,
%d bloggers like this: