Platinum Partner

Currency Formatted String To Number

Makes a currency-formatted string numeric

function currency2float(m){
    var pattern  = /[\.,][-|–]?$/;           /* 100.-- >>> 100 */
                                             /* 100,-  >>> 100 */
    var m = m.replace(pattern, "");
    
    var pattern  = /[\.,]([\d]{0,2})$/;      /* 100,95 >>> 100X95 */
    var m = m.replace(pattern, "X$1");
    
    var pattern  = /[\.',]/g;                /* delete ' , .  */
    var m = m.replace(pattern, "");
        
    var m = m.replace(/X/g, '.');            /* 100X95 >> 100.95 */
    
    if(isNaN(m*1)) return false;
    return(m*1);
}
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}