Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6161 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Okay, here's the scenario...I have a series of 'number' formatted fields. In the 'number format...' option, they're formatted as "Format As Decimal" with two digits of precision. These fields are used to enter dollar/cents amounts. I'd like to be able to copy the contents of these number fields, and paste them into a single text formatted field, with carriage returns separating the dollar/cents entries. I suppose this would be considered a merge, since I'm copying data from multiple fields, and am pasting them into a single field. Not sure, though. Anyway, I have created a script that goes to these number-formatted fields, copies the content, shifts over to the target text field, and pastes the content with a carriage return. It works beautifully, with one exception. If I enter "363" into one of source number-formatted fields, it DISPLAYS as "363.00", but pastes as "363" over in the target text field. The question is: how do I get my trailing ".00" to copy over?

Sorry for being ultra verbose here, but I want to make sure I get the point across. Thanks in advance for any thoughts on this!

Jason

Posted

Simplest way would be to force the number fields to have two decimals using a calculaton field with a text result.

That calculation could be...

__________________

Let([

num = Round(numberField;2);

integer = int(num);

dec = Length(num-int)

];

"$" &

Case(

lengthDec = 0; num & ".00";

lengthDec = 2; num & "0";

num)

)

__________

But it depends, if the number could be negative or in the thousands or greater the calc will need to be adjusted.

This topic is 6161 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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