this is a suitably interesting question that it's worthy of an interesting answer.
Firstly, we need to consider ways numbers can be typed in; and then we'll deal with your special case.
nnn-nn, nn-nn, n-nn, n, nn, nnn nn-n
are all fairly unambiguous. the separator, be it , or . is the decimal indicator.
if the number can be more than 999.99 though you get a complication. Because then you could have
n,nnn.nn or n.nnn,nn so the algorithm for parsing the number needs to be more complex.
fortunately in your case the number is @n5.2 so that's not a consideration for now.
Secondly we want to embed code in one place, but which works for both the immediate field, and also when the user clicks on Save. That means the ValidateValue::Fieldname embed.
the following code translates a , into a .
num string(15)
x long
If p_web.RequestAjax = 1 and p_web.ifExistsValue('Value')
p_web.SetValue('ALI:Roman',p_web.GetValue('Value'))
end
num = p_web.GetValue('ALI:Roman')
x = instring(',',num,1,1)
if x > 0
num[ x ] = '.'
end
ali:roman = num
The first IF takes care of the dynamic case, after that the Ali:Roman field is "re-parsed" from the original "value".
Any questions?