Number Formatter is Now Localized

Code, Knowledge Base, News No Comments »

We have been working real hard recently as we have been adding features due to growing users’ demands. One new feature is number formatting has now internationalized and can be localized to any country’s commonly used numeric format. And we realized most of the time the commonly used numeric format is following the currency format in that particular country.

US, UK and many more #,##0.00
Estonia, France # ###,##
Germany, Italy #.###,##
Japan #,####.##
Korea #,###
Switzerland #’###.##

The table showing some of the countries that having different currency formats, it is quite surprising to see all kind of possibilities and combinations. So the number formatter need to be extremely versatile almost like a spreadsheet custom formatting. So, is that mean the new number formatter parser will be bloated? No, totally opposite, despite we are adding in more feature, we also working hard in stripping down the code in order to avoid it from growing proportionally to more and more features. Moreover, we even speed up the code execution from every possible aspects.

We have been and still using many external open source libraries like JQuery, and we think it’s time for us to contribute back to the community whenever possible. So we are now publishing this JavaScript Number Formatter to Google Code Project.


Share

Version Mismatched in Support Information

Code No Comments »

If you have ever checked for application version from “Support Information” in Add or Remove Programs applet (or Version column in Programs or Features applet in Vista or above), you may noticed some applications (including IntegraXor) have mismatched version number displayed here compared to the one in their respective binaries. This is because the Windows fetches the version from the application installer. If the application installer reports a different version than the version compiled into the binaries, or worst, if the application installer does not report a version at all, then you see a mismatch.

Support Information version mismatched or conflict

IntegraXor binaries and installer are developed using Visual Studio, the binaries version string is in MM.NN.BB.RR (major.minor.build.revision) format, while Installer project only allow version string in MM.NN.BB (major.minor.build) format. This caused the version mismatch in IntegraXor “About Box” and in “Add or Remove Programs” applet.

Versioning scheme is not as simple as incrementing numbers, there are quite some aspects to be considered as well to ensure it’s systematic and consistent. In order to ensure the About Box version is matched with Support Information pop up, we will now start with version string of MM.NN.BBBR.0 (major.minor.build+revision.0) format, and BBB will be used for stable release and R will be used for beta numbering. Stable release will always have trialling zero for R and Beta release will have incremental number from the last stable release.

For example:

3.60.4011.0 -> beta

3.60.4012.0 -> beta

3.60.4013.0 -> beta

3.60.4020.0 -> stable

3.60.4021.0 -> beta

3.60.4022.0 -> beta

3.60.4030.0 -> stable

… …

Share

Function, Object, Status.

Code, Knowledge Base, Web No Comments »

Recently we found that Firefox has changed the type of object of a function. Below is the test code:

<DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>FX function status test</title>
</head>
<body>
    <script type="text/javascript">
        function hello() {
            this.hello = "hello";
            this.world = "world";
            this.status = "status";
 
            var txt = this.constructor;
            txt += this.hello + " " + this.world + " " + this.status;
            document.getElementsByTagName('body')[0].innerHTML = txt;
        }
        hello();
    </script>
</body>
</html>

This test attempted to show what type of constructor the function ‘hello’ is on browser, and also the properties ‘hello’, ‘world’ and ‘status’. As the screen shot shown, different browser treats the function object differently, especially Firefox. Latest Firefox (in this case, version 4 beta 6) treated it as an Object. but previous version of Firefox (3.6.3 or older) treated it as an object Window and note that ‘status’ is missing from Firefox’s output as compare to other browsers. This mean Firefox prohibited the usage of property name of “status”. A property name that called “status” can only be used when it is in a Javascript class.

result in various browsers

On the other hand, one foolproof practice is to convert a function object into a new Javascript class like below:

function myFunc() {
    if (!(this instanceof Object)) {
        return new myFunc();
    }
 
    this.hello = "hello";
    this.world = "world";
    this.status = "status";
    return this;
}


This code will fail since Firefox 3.6.8+ updated its instance to Object (as shown in screen shot). As a result, developer need to remove this interlocking code as it’s no longer useful, but the workaround is to call it as a new function class when using it.

Share

Designed by j david macor.com.Original WP Theme & Icons by N.Design Studio; Modified by ecava.