April 11, 200322 yr hello people! I know that for the most part [FMP-Field:name,format] should work but here is a nice script that does the mentioned format when CDML is not available: original page source:http://developer.irt.org/script/number.htm <script> function outputMoney(number) // script source -->http://developer.irt.org/script/number.htm { return outputDollars(Math.floor(number-0) + '') + outputCents(number - 0); } function outputDollars(number) { if (number.length <= 3) return (number == '' ? '0' : number); else { var mod = number.length%3; var output = (mod == 0 ? '' : (number.substring(0,mod))); for (i=0 ; i < Math.floor(number.length/3) ; i++) { if ((mod ==0) && (i ==0)) output+= number.substring(mod+3*i,mod+3*i+3); else output+= ',' + number.substring(mod+3*i,mod+3*i+3); } return (output); } } function outputCents(amount) { amount = Math.round( ( (amount) - Math.floor(amount) ) *100); return (amount < 10 ? '.0' + amount : '.' + amount); } </script> ...... document.write(outputMoney(1000.470334)); my little contrib. if anyone needed to know
April 11, 200322 yr For WebCompanion I was using text calculated fields. In current Lasso 6 I've created custom tags to do such stuff and also to use similar names like in FM.
Create an account or sign in to comment