Skip 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.

Substitute Dollars

Featured Replies

Hi everyone!

I am importing a set of data. My fields are number. The data is listed as $73.15. I have written a script to remove the $ and change the amount to a minus. The script does remove the $ but doesn't add the minus! I assume it's because my fields are numeric? Any suggestions on how to accomplish this?

GoTo Record/Request/Page

[ First ]

Loop

Set Field [ Charges, Substitute( Charges, "$" , "-" ) ]

Set Field [ AmountAllowed, Substitute( AmountAllowed, "$" , "-") ]

Set Field [ Payment, Substitute( Payment, "$", "-") ]

Set Field [ CoPay, Substitute( CoPay, "$", "-") ]

Set Field [ Withhold, Substitute( Withhold, "$", "-") ]

Set Field [ FFSEquity, Substitute( FFSEquity, "$", "-") ]

Set Field [ COBDeduct, Substitute( COBDeduct, "$", "-") ]

Go to Record/Request/Page

[ Next, Exit after last ]

End Loop

LaRetta

Well -73,15 = 73,15- (73,15*2).

you could have a calc for that and then a setfield command in your script.

Sure there will be another solution though...

  • Author

Hi Ugo!

Well that didn't work. I even tried "Charges" - "Charges" and that made all numbers "0" YIKES! This shouldn't be difficult! crazy.gif

UPDATE: Duh! Charges - Charges = 0 of course blush.gif

I changed it to Charges - Charges * 2 and it worked!! Okay, okay, I've been up all night!

LaRetta

Strange but it does work for me...

field num = $75,25

calcnegative = filed num -(fieldnum*2) = -75,25

setfield field num (calcnegative) = -75,25

  • Author

Thanks Ugo!

Yes, I think I've just reached brain-death. Of course it works when I enter it right grin.gif Thanks for helping!

LaRetta

Here is the file.

i'm almost sure Andy or others would come with a relationship calc using constant OnetoOne and no script at all grin.gif

Will wait and see

Hi LaRetta, Ugo

Well, as I see the things (laRetta), the script you gave fail to success simply because those fields are numbers and when casting the contents of the field to number (and that's what is happening as the result of set field with numeric result of calculation) the $ signs(or any other non numeric char except -) is droped and there is nothing to replace with "-" .

So instead use simply:

Set Field[theNumericField,(-1)*theNumericField]

Dj

  • Author

Hi Ugo and DJ!

That worked perfectly! Thanks to both of you. Actually, using SET in this way has sparked quite a bit of interest in me. shocked.gif

LaRetta

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.