Jump to content

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

Recommended Posts

Posted

What I need to do is make a text field that takes the result of a calculation in another field and makes it text with trailing zeros. FM numbers insist on dropping these, so I always get "prices" that look like:

12.95

12.5

12

I need them to look like (in my new text field);

12.95

12.50

12.00

so I can export the result to a DOS app that requires this. I tried to set up a three function Case using Position nested inside of Right to hunt for the decimal point as a text string, and depending on where it is found (third character from right, second character, or not there at all) to add 2, 1 or no zero characters to the end of the number. But I got hopelessly lost in calculation syntax.

Anybody know an easy way to do this?

Steve Brown

Posted

In layout mode, use the menu 'Format > Number' to bring the format dialog box up.

If you ever need to export those fields, remember to check the option to use formating in the export dialog box.

Posted

I can't export a layout format, as my text price field gets embedded into a large concatenation field, and *this* is the field exported.

But both of those two calcs work beautifully. I chose the second one posted (Left ..., Length ...) because I can follow what is happening here. Very clever and elegant. I don't quite grasp the modular function, so decided to go with something I might need to look at again some day.

Thanks, slstrother.

Steve Brown

Posted

There is a number calculation in my Handy Bits file in the samples section which converts numbers to currency formats for use in exported text and for web requirements. If you pull the calc apart, just delete the first line if you don't want the "$" symbol in the result.

This topic is 8155 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.