If you have Advanced you can certainly find a custom function for your needs (for free).
If you don't have Advanced, you can implement a custom function in a script.
p.s. sorry - the site fmcustomfunctions.com is currently off-line, for me anyway.
Or, if all you need is inches<->centimeters:
$inches = $centimeters / 2.54
$centimeters = $inches * 2.54
A custom function would be the easiest way to implement this.
dag! sorry - I think I've been skirting around your question.
You would need to decide on a standard unit, say centimeters. This would be the number field. Then, there would be the calculated number field you mentioned to convert the standard unit (cm) to show as inches. Then, all of your data entry on the inches side of the interface would need to be converted to centimeters in order to update the base length (cm) field.
(Of course, we need to avoid having two (non-calculated) number fields that represent the same thing.)
clearly, I'm still chewing on this ...
you could have a global $$variable or field that is set upon opening the file. That field/variable would be either (2.54 or .394) or 1, depending on if you are multiplying or dividing, and the standard unit that you choose (a.k.a. the "convention" you decide on). Once set, all data-entry processes multiply (or divide) all length entries by this global (local) value, based on the convention. If the user chooses the standard unit, then they are multiplying (or dividing) by 1.
Thanks for your thoughtful replies, David. I don’t know if this will help but I thought I’d explain that 95% of the material in the database I’m creating is made up of documents, manuscripts and graphic works by Italian or French authors with the remaining 5% being other European authors. The database is therefore being creating in Italian. All of the data in the fields as well as the measurements of the works are in inches since I measured and entered the data as I photographed each document. They are in a text field in the format 8.5 x 12” (width x height), for example, and I think you are suggesting that this should be a number field, or 2 number fields, width and height. What I am hoping is that the calculation field or fields would be something like W * 2.54 x H* 2.54. Obviously the values of W and H change for each asset page. Since all the data entered on the Italian side automatically appears on the English language pages I really only need to structure the inches to centimeters conversion. Since I’m unfamiliar with calculation fields I will have to experiment a little with them guided by your remarks for which I am very grateful. I have attached a page from the database. I left the measurements field (Dimensioni) very wide initially assuming I’d have to have two fields in that space, one in inches and one in centimeters. Before continuing with entries I’d like to try and solve the conversion issue, hopefully by means of an automatic calculation field. Many thanks for your time thinking about my problem. I really appreciate your thoughts and will give it a go tomorrow.
I see. That follows along with my cryptic answer above. Just say, "hey user, we work in inches - if you want to see centimeters, look to the right." Easy-peasy.
Now, to convert what looks like text: 10 x 15 ... you need to use the FM functions GetAsNumber, LeftWords and RightWords. You need consistency in your data to make this work. I recommend replacing your text field with two separate number fields: Width and Height (and calculations width, cm and height, cm) instead of a text "W x H" format.
I too am about to hibernate - give us feedback when you can.
p.s. here's my artsy-fartsy FileMaker game:
Thanks, David. Yes, I think that will work just fine. Be in touch tomorrow after I try out your functions. Grazie mille!
Sent from my iPhone, TE
Just a quick update. I created two number fields and two calculation fields.
I tried your script functions GetAsNumber, LeftWords and RightWords but
wasn¹t sure what they were meant to work exactly so I¹m sure my syntax was
to blame. Since I had the measurements in inches I created the centimeter
calculation fields with the simple formula: DW* 2.54 and DH* 2.54 for
dimension width and height as per your suggestion to use separate fields for
W and H. I assumed your LeftWords and RightWords were meant to work with my
original dimension field structure ( width x height²), but as I say I didn¹t
find the necessary syntax so I went the simple route. The original dimension
text field is under the label and I¹ve been just plugging in the values into
the two new number fields on the far right of the Dimension line and the
values in centimeters appear immediately in the two calc fields to the left.
Once I¹ve transferred the values for all the assets I¹ll be able to delete
the original Dimension text field.
Thanks so much for your help.
Tom EckerleSoup to Nuts, Inc.398 Altamont Road
Millbrook, NY 12545
T: 845 677 5033C: 646 468 9172