Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. How to convert the following C# line?

How to convert the following C# line?

Scheduled Pinned Locked Moved Managed C++/CLI
csharpc++tutorialquestion
5 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paramu1973
    wrote on last edited by
    #1

    Hi Iam trying to convert my Digit To Words class from c# to VC++... And the following line I am facing trouble

    String^ strNum;
    String^ strNumDec;
    String^ StrWord;
    strNum = Convert::ToString(Num); // Num is Decimal Parameter
    blah..blah...blah...

    StrWord = ((double.Parse(strNum) == 1) ? " Rupee " : " Rupees ") + NumToWord((decimal)(double.Parse(strNum))) + ((double.Parse(strNumDec) > 0) ? (" and Paise" + cWord3((decimal)(double.Parse(strNumDec)))) : "");

    Thanks for the helps:thumbsup:

    L W 3 Replies Last reply
    0
    • P Paramu1973

      Hi Iam trying to convert my Digit To Words class from c# to VC++... And the following line I am facing trouble

      String^ strNum;
      String^ strNumDec;
      String^ StrWord;
      strNum = Convert::ToString(Num); // Num is Decimal Parameter
      blah..blah...blah...

      StrWord = ((double.Parse(strNum) == 1) ? " Rupee " : " Rupees ") + NumToWord((decimal)(double.Parse(strNum))) + ((double.Parse(strNumDec) > 0) ? (" and Paise" + cWord3((decimal)(double.Parse(strNumDec)))) : "");

      Thanks for the helps:thumbsup:

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Paramu1973 wrote:

      trouble

      And that trouble would be what exactly?

      Paramu1973 wrote:

      blah..blah...blah...

      is not valid C++ or C# code.

      1 Reply Last reply
      0
      • P Paramu1973

        Hi Iam trying to convert my Digit To Words class from c# to VC++... And the following line I am facing trouble

        String^ strNum;
        String^ strNumDec;
        String^ StrWord;
        strNum = Convert::ToString(Num); // Num is Decimal Parameter
        blah..blah...blah...

        StrWord = ((double.Parse(strNum) == 1) ? " Rupee " : " Rupees ") + NumToWord((decimal)(double.Parse(strNum))) + ((double.Parse(strNumDec) > 0) ? (" and Paise" + cWord3((decimal)(double.Parse(strNumDec)))) : "");

        Thanks for the helps:thumbsup:

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        What type is Num and why are you converting it to a string just so that you can parse it into a double? Please provide more details of exactly what problem you are trying to solve.

        P 1 Reply Last reply
        0
        • L Lost User

          What type is Num and why are you converting it to a string just so that you can parse it into a double? Please provide more details of exactly what problem you are trying to solve.

          P Offline
          P Offline
          Paramu1973
          wrote on last edited by
          #4

          Thanks Richard...Still I remember your powerful helps.....Num is Decimal and I found the solution... Thanks Again

          1 Reply Last reply
          0
          • P Paramu1973

            Hi Iam trying to convert my Digit To Words class from c# to VC++... And the following line I am facing trouble

            String^ strNum;
            String^ strNumDec;
            String^ StrWord;
            strNum = Convert::ToString(Num); // Num is Decimal Parameter
            blah..blah...blah...

            StrWord = ((double.Parse(strNum) == 1) ? " Rupee " : " Rupees ") + NumToWord((decimal)(double.Parse(strNum))) + ((double.Parse(strNumDec) > 0) ? (" and Paise" + cWord3((decimal)(double.Parse(strNumDec)))) : "");

            Thanks for the helps:thumbsup:

            W Offline
            W Offline
            WuRunZhe
            wrote on last edited by
            #5

            Is it really C# code? :)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups