Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7711187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:18:45+00:00 2026-06-01T01:18:45+00:00

I have a small tab on an app that allows user to lookup a

  • 0

I have a small tab on an app that allows user to lookup a price in a price table and it returns the price. how can i get the ‘$’ sign on the returned price?

public double? SearchMedicinePrice(Int64 pNDC)
{
    double? retValue = null;
    objConext = new FDBEntities();
    Medicine objMedicine = objConext.Medicines.Where(med => med.PriceType == 9 && med.NDC == pNDC).OrderByDescending(item=>item.MedicineID).FirstOrDefault();
    if (objMedicine != null)
    {
        retValue = objMedicine.Price;
    }
    return retValue;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:18:47+00:00Added an answer on June 1, 2026 at 1:18 am

    When you call ToString() on a double (and many other types), you can pass in a format string to specify how the result should be formatted. Like this:

    double price = 10.5;
    price.ToString("C");
    

    Output = $10.50

    You could also use String.Format like this:

    string message = String.Format("The price is {0:C}", SearchMedicinePrice(pndc));
    

    {0:C} is a format string. The C specifies that the value should be formatted as currency.

    You can also pass in a CultureInfo object to configure things like the currency symbol. For example, the following code will output £10.50

    10.5.ToString("C", new CultureInfo("en-GB"))
    

    You might also consider using decimal instead of double for storing currency data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have small web app that generate PDF files as a report. I'm trying
I'm writing a small web app that will receive and parse tab-delimited text files
Have created a small two tab app, then subclassed another view controller to create
I have a small .get() that receives a block of HTML from a php
I have an iPhone app (in XCode 4) that uses the standard Tab Bar
I'm a little bit lost. I have created a small app that is starting
So I have this small xls file that's actually a tab-delimited txt file. In
I have small test app: Socket socket = new Socket(jeck.ru, 80); PrintWriter pw =
i have small function that running on condintion, if text box value is not
I have developed a small iPhone application by using singleton that I use to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.