Display Currency value with commas and two decimals in Zoho Creator

string nullFix.currencyToStr(float num)
{
    //num = 1234567.98;
    myStr = "0.00";
    if (input.num  !=  null)
    {
        input.num = input.num.round(2);
        myStr = input.num.toString().replaceAll(("(?<!\.\d)(?<=\d)(?=(?:\d\d\d)+\b)"),",");
    }
    return myStr;
}

Live Preview… Try different currency values below and hit tab key