I have a solution to your problem (although it is pretty rough).
//StartNum [Decimal] assigned to Text001 textbox
//Conversion [Text] assigned to Text002 textbox
Mask := '%1'; //Local Variable [Text]
MiddleMan := STRSUBSTNO(Mask,StartNum); //Convert from Decimal to String and store in local var MiddleMan [Text]
Conversion := ''; //Can use a local variable to store the makings but I just assigned to global variable
FOR Counter := 1 TO STRLEN(MiddleMan) DO BEGIN
IF (MiddleMan[Counter] = '0') AND (FoundIt) THEN BEGIN
Conversion := Conversion + 'X';
END ELSE BEGIN
Conversion := Conversion + STRSUBSTNO(Mask,MiddleMan[Counter]);
END;
IF MiddleMan[Counter] = '.' THEN FoundIT := TRUE; //Mark when we find the decimal point
END;
Ok ok ok, here is a much more refined code to do exactly what you want...
MiddleMan := STRSUBSTNO('%1',StartNum);
Counter := STRPOS(MiddleMan,'.');
Counter := 3 - (STRLEN(MiddleMan) - Counter); //3 is the # of places past the decimal point.
FOR intCount := 1 TO Counter DO
MiddleMan := MiddleMan + 'X';
Conversion := MiddleMan;
Comments
try it.......
Rajesh Patel
I have a solution to your problem (although it is pretty rough).
Well you can just adjust the code I have provided to come up with the solution you desire.