Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JavaScript: Format 1000.470334 --> 1,000.48

Featured Replies

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

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.