>nvar1=130.30
>?CHRTRAN(STR(nvar1,6,2),SET("POINT"),"-")
>
>But the value of nvar1 may different as
>130.30
>1235.20
>15487.10
>
>Then how to set point?
Read the help for Set Point and Set Decimal - they are quite different. Also, try
?set("point")
?set("decimals")
and see what you get on your machine. Whenever a set(...) function is mentioned, it means that you have to allow for a setting different from yours. Specifically, some cultures have a decimal point and comma for thousands separator, some have a decimal comma and point for thousands separator. Martina's solution will work regardless of how it was set.
In case I got you wrong, if your problem is the possible length of the string...
?alltrim(CHRTRAN(STR(nvar1,16,2),SET("POINT"),"-"))