If ( Field < 1 ; "0" ) & Field
would supply the missing zero.
I'd need to see your calculation before I could make any guess as to why you are getting commas like you are. Make sure that your result type is text and not number.
If I put .329 in a number field, with the inspector setting for number as decimal, with nothing checked, I get 0.329. Then you could use a simple loop script, global field to append all the fields and have them comma separated:
Set Field [Table::globalField; ""]
Go to Record/Request/Page [First]
Set Field [Table::globalField; Table::globalField & "0" & Table::calcField & ","]
Go to Record/Request/Page [Next; Exit after last]
I will check both answers, but Steve, keep in mind that I'm not using a number field but a calculated field that divides 2 numeric fields.
Since you are using a calculation to pull multiple values into the same field, you can't use the data formatting option from the inspector--which otherwise would be the far simpler option.
This is what I have while I continue having problems:
ActivityIndex: number field
Holds a count of numbers.
ActivityIndexMax: summary field
Maximum of ActivityIndex
ActivityRatio: calculation field
Is a division between (ActivityIndex/ActivityIndexMax) * 10
$ActivityRatios = ""
A variable where I store all the ActivityRatios separated by comma and then dump it all into a text field.
If I use the suggested formula,
$ActivityRatios & "," & If ( ActivityRatio < 1 ; "0" ) & ActivityRatio
I get MORE :-) unneded zeroes
The first 2 "00" should be "0"
The next 0,32 is fine, but it gets unrecognizable from the separating comma.
So I have 2 problems:
1) How to get the needed zeros but no more, and I think that I can solve it using
If ( ActivityRatio < 1 ; "0";ActivityRatio)
I should get 0 if below 1 and the field data if over, OK?
2) How to get dots for decimals and commas to separate values.
Thanks a lot if you can help me here
As I stated in my first post. My suggestion was only to supply a leading zero and would have no affect on the problem with commas as I would need to see the full calculation.
You should not be getting commas as decimal point symbols like you are unless someone has set up a locality setting for a location that uses commas as the decimal symbol. I would guess that if you clicked into the activityratio field, you might see values that use a comma as the decimal point.
The leading zero issue can be resolved by refining the If funciton:
If ( ActivityRatio > 0 and activityRatio < 1 ; "0" )