Jump to content
Salesforce and other SMB Solutions are coming soon. ×

negative to posative


scittneh

Recommended Posts

Hello

 

Hopefully someone can help with my question.

 

I have a negative number that i need to change to a positive number.

 

ie. -3 needs to read as 3

 

is this possible?

 

 

thanks in advance.

Link to comment
Share on other sites

Use the Abs[number] function. The Absolute value of a number is always positive, whether the number is positive or negative.

 

If you want to do it on only one record at a time, your script should loop through the records and you would have a script step of

Set Field[myNumberField;Abs[myNumberField]]

 

If you want to convert a whole batch of records at once, perform a find to find the relevant records, and use

Replace Field Contents [myNumberField;Abs[myNumberField]]

 

EDIT:To use Replace Field Contents[], the field must be on the current layout

 

Doug

Link to comment
Share on other sites

Use the Abs[number] function. The Absolute value of a number is always positive, whether the number is positive or negative.

 

If you want to do it on only one record at a time, your script should loop through the records and you would have a script step of

Set Field[myNumberField;Abs[myNumberField]]

 

If you want to convert a whole batch of records at once, perform a find to find the relevant records, and use

Replace Field Contents [myNumberField;Abs[myNumberField]]

 

EDIT:To use Replace Field Contents[], the field must be on the current layout

 

Doug

 

Sorry to nit-pick, but use parens instead of square brackets for a function call:

 

abs(myNumberField)

Link to comment
Share on other sites

Sorry to nit-pick, but use parens instead of square brackets for a function call:

 

abs(myNumberField)

 

Thanks, Ender. I apologize for the brain cramp.

 

--Doug

Link to comment
Share on other sites

EDIT:To use Replace Field Contents[], the field must be on the current layout

Not since version 7 it doesn't. smiley-wink

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use