locked
negative numbers sign RRS feed

  • Question

  • Hello friends,

    I have designed a form using a font of local script. In this font's character map, instead of '-' (dash or minus sign) another character is asigned to ascii code 45.

    This is causing the negative numbers not being displayed properly. Can I change the default character that preceds the negative number in vfp?

     

    Saturday, March 29, 2008 7:34 AM
    Answerer

Answers

  • Not as far as I know. Numeric data is stored in VFP using Reverse Polish notation. The representation of a negative number is handled by the core processes and I don't think you can change what is used.

     

    If you converted the number to a string you could then use CHRTRAN() to change the character in your strings (you can use TRANSFORM() or STR() or even PADL() to handle the conversion...)

     

    Code Snippet

    lcNum = TRANSFORM( numeric_value  )

    lnNum = CHRTRAN( lcNum, CHR(45), CHR(XXX) )

     

     

     

    Saturday, March 29, 2008 11:25 AM

All replies

  • Not as far as I know. Numeric data is stored in VFP using Reverse Polish notation. The representation of a negative number is handled by the core processes and I don't think you can change what is used.

     

    If you converted the number to a string you could then use CHRTRAN() to change the character in your strings (you can use TRANSFORM() or STR() or even PADL() to handle the conversion...)

     

    Code Snippet

    lcNum = TRANSFORM( numeric_value  )

    lnNum = CHRTRAN( lcNum, CHR(45), CHR(XXX) )

     

     

     

    Saturday, March 29, 2008 11:25 AM
  • Numeric data is stored in VFP using Reverse Polish notation.

     

    There used to be a program on the British tv - maybe still is - , titled I didn't know that

     

    Saturday, March 29, 2008 6:21 PM