Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CosmosDb Product Listing missing currency. #4

Open
Pip1987 opened this issue Feb 4, 2024 · 1 comment
Open

CosmosDb Product Listing missing currency. #4

Pip1987 opened this issue Feb 4, 2024 · 1 comment

Comments

@Pip1987
Copy link

Pip1987 commented Feb 4, 2024

Page 297 Listing all products from the CosmosDB says to set the current culture to french to see the euro symbol. However the output for the unit price is converted to string and not displaying the currency symbol. Removing the ToString from unitPrice fixes this issue.

foreach (ProductCosmos product in products)
{
    WriteLine("id: {0}, productName: {1}, unitPrice: {2}",
    arg0: product.id, arg1: product.productName, 
    arg2: product.unitPrice.ToString());
}

to

foreach (ProductCosmos product in products)
{
    WriteLine("id: {0}, productName: {1}, unitPrice: {2}",
    arg0: product.id, arg1: product.productName, 
    arg2: product.unitPrice);
}
@Pip1987 Pip1987 changed the title CosmosDb Product Listing missing currancy. CosmosDb Product Listing missing currency. Feb 4, 2024
@markjprice
Copy link
Owner

I started to look into this but I don't have CosmosDB emulator set up and since I have publishing deadlines at the moment I will have to look at this another time. I will leave the issue open to remind me. Thanks for raising this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants