Treat this as text rather than as a number.
One starting idea would be
list=substitute(nbr; "." ; "Pilcrow") Pilcrow is the carriage return
whole = getvalue(list;1)
dec = getvalu(list;2)
dec = dec & "000"
dec = left(dec;3)
whole & "." & dec
This is psuedocode so you'll have to verify the code.
Result: 1000.1 becomes 1000.100
Result: 1000.11111 becomes 1000.111
I tend to do things like this in steps rather than one long string since its easier to understand, debug and change.
So I write opposite for variation of answers
Int ( n ) & "." & SerialIncrement ( "000" ; Mod ( Abs ( n ) * 1000 ; 1000 ) )
This is tested on some numbers, but there can be bug as always.
Need Abs() made me unhappy.
Merge fields can also be formatted via the data formatting options in the inspector--though you are restricted to one data format per data type per layout text object when you do so. That shouldn't be a problem here.
Thank to all for the feedback !
jbante in my trials, data formatting is not maintained inside the Button Bar label: it cuts decimals no matter of data formatting
philmfdjunk data formatting for merge fields is clear, it is not clear for me how to put a merge field inside the Button Bar: it seems not accepting it
The merge field would be placed as it's own object on top of the buttons in the button bar.
And after testing this in the relatively new button bar, we do seem to have a design limitation here. Using a field reference as the label for a button allows us to include the field contents as the button label, but I can't find a way to format that value in the inspector--I'd have to substitute a calculation field that uses a calculation to produce the needed format.
I do not encounter these issues when using a button that is not a part of the button bar. I can then enter the merge field reference directly as the button's label.
Yes philmfdjunk exactly what I experienced.
For now I solved this way (as label for Button Bar) where FIELD_A is the calculated numeric value with 3 or less decimals
right (FIELD_A; 3) = "," ; FIELDA ;
right (FIELD_A; 2) = "," ; FIELDA & "0" ;
FIELD_A & ",000")
This can't be the way you resolved... at least you need a case for appending "00"
And your first question have 5 decimals in example, not "3 or less". For the number with 3 or less dicimals, it can be
Replace ( n * 1000 ; Length ( n*1000 ) - 2 ; "" ; "," )