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 7005709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:23:07+00:00 2026-05-27T21:23:07+00:00

I have a list that contain two colums which are type currency. I want

  • 0

I have a list that contain two colums which are type currency. I want to be able to read the values from this field with the decimal places and the currecy symbol included.

I have tried three different methods but I only seem to get the numbers and not the currecny symbol. Also decimal values are not being properly displayed. The columns that use the decimal type are “InstallCosts” and “RentalCosts”.

foreach (SPListItem item in listItemCollection)
{
try
{
string MPLS;
if ((bool)item["MPLS"])
MPLS = "Yes";
else
MPLS = "No";

//Conversion 1
double installCost;
bool convert1 = double.TryParse(item["InstallCosts"].ToString(), out installCost);

double rentalCost;
bool convert2 = double.TryParse(item["RentalCosts"].ToString(), out rentalCost);


//Conversion 2
string install = item["InstallCosts"].ToString();
double installConverted = double.Parse(install, NumberStyles.Currency,
CultureInfo.CurrentCulture.NumberFormat);

//Conversion 3
//string converThis = String.Format("[0:c}", (string)item["InstallCosts"]);


string results56 = (string)item["Title"] + " " + (string)item["DefinedFor"] + " " +
"<b>MPLS:</b> " + MPLS + "<br/>" + "<b>Max Downstream:</b> " + 
(string)item["MaxDownstream"] + "<br/>" + "Install Cost:" + converThis + "<br/>" 
+ "Rental Cost (p.a.):" + rentalCost + "<br/>";

AvailabilityCheckerResultsTwo.Controls.Add(new LiteralControl(results56));
}

The result is the following:

Alpaca A dirty ADSL product for: CCTV third-party remote access interactive models and web site testing. MPLS: No
Max Downstream:
Install Cost:50
Rental Cost (p.a.):425.7

The resuts for “Install Cost” should be : £50.00
The result for “Rental Cost” should be : £425.70

I have being stuck with this problem for a day now, would appreciate any assistance its probably something I am missing but I can’t really see what!

Many Thanks,

  • 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-05-27T21:23:08+00:00Added an answer on May 27, 2026 at 9:23 pm

    In .net the numbers do not contain any currency or any other formatting information. So you have to add the currency symbol on your own:

    SPListItem item = ...;
    double d = Convert.ToDouble(item["InstallCosts"]);
    // will display the number in the current threads culture. In the US: $ <value>
    string currency = d.ToString("C"); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file that contain list of numbers that looks like this: 10^-92
I have two lists. I need to determine which word from the first list
I have a list of strings that contain banned words. What's an efficient way
I have a listview that is loaded with a list of objects that contain
I have a simple class with an attribute that can contain a list of
I have a variable that can either contain a list of strings or a
I have a PersonEditorModel that contains a list of people that I want represented
I have a function that returns a list like this:- List <Column <String1, String2>>
I have a list of objects that contain row data for a table. There
I have two tabs named respectly liste_pieces and client_pieces. The first contain a list

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.