This course will be retired on July 14, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
We'll add serialization logic and make our request to the Text Analytics API.
Parsing the Sentiment Score to a Double
If you're not located in the United States, you might need to call an overload of the double.TryParse
method that allows you to pass in the "en-US" culture info in order to successfully parse the string value.
double score;
if (double.TryParse(sentiment.Score, NumberStyles.Any,
CultureInfo.GetCultureInfo("en-US"), out score))
{
newsResult.SentimentScore = score;
}
For more information about how to get and set your current culture in .NET, see the MSDN documentation page for the CultureInfo.CurrentCulture
property.
Formatting Numbers
Standard Numeric Format Strings
Project Ideas
- Build an app that integrates with data from a public API.
- Check out this list of public APIs and find something you're interested in!
- Use other API services from Microsoft Cognitive Services
- Download CSV or JSON datasets from Data.gov and load it into your application
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Eric Wilson
9,380 Points1 Answer
-
Richard Oden
15,350 Points0 Answers
-
chazber
4,873 Points1 Answer
-
okilydokily
12,105 Points1 Answer
-
samgaudet
8,451 Points1 Answer
-
Mark Ramos
19,209 Points0 Answers
-
PLUS
Radu - Adrian Buha
Courses Plus Student 5,535 Points2 Answers
-
Hakim Rachidi
38,490 Points0 Answers
-
Thimmy Stenlund
7,523 Points6 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up