Convert ASP to C#

Hi all
I need to convert the code below to C#

BProdukt = right("0000000000"+cstr(FormatNumber(preisupdate("FFaktorProdukt"),9,,,0)),19)

Thanks in Advance

ZURINETAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Anton_SivovCommented:
Hi Zurinet,

Could you please say me, does the preisupdate is a function withing return type string?
ZURINETAuthor Commented:
Hi Anton..

BProdukt = right("0000000000 "+cstr(FormatNumber(100.5,9,,,0)),19)

It looks better now..

Back to your question.. the Preisupdate is just a function.. but it not relevant..
The query above is okay.. if you can convert it
Anton_SivovCommented:
Ok,
If the preisupdate somethings like

function preisupdate(anyValue)
      preisupdate = "10,0123456789012345"
end function

you can use the following code to solve you issue:
private string preisupdate(string anyValue)
        {
            return "10.0123456789012345";
        }

        private string GetBProdukt (string anyValue)
        {
          if (Decimal.TryParse(preisupdate(anyValue), out value))
            {
                return value.ToString("000000000.000000000"));
            }
          return null;
        }

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ZURINETAuthor Commented:
Hi Anton
Thanks for your input .. I have just modified your code

private string GetBProdukt (string anyValue)
        {
          Decimal value;
             if (Decimal.TryParse(preisupdate(anyValue), out value))
            {
                return value.ToString("000000000.000000000"));
            }
          return null;
        }
Anton_SivovCommented:
Welcome :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.