Developer forum

Forum » Dynamicweb 10 » Price questions

Price questions

Lars Hejgaard Sørensen Dynamicweb Employee
Lars Hejgaard Sørensen
Reply

Hi,

One of our customers asked a question that I wasn't able to answer:

In Products on the Prices & stock the price is dosplayed with comma as decimal separator, and in a different font than the rest of the UI. But on the price editing page, the price displayed with dot.

 

So, for the price editing it looks like it's adapting the client culture, but on the overview it looks like another culture setting is used. Is there a setting we can use to align this to either on or the other?

Thanks :)

Br.

Lars


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Wonders of tech...

The price in the list is formatted using .NET string formatting, specifically ToString("N2") in whatever culture the server is running.

When editing we are using an input type=number (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number) and how that behaves is handled by the browser. I think the default browser behavior is to use your machines locale - my machine is in Danish and shows 259,99 in the editor.

Some browsers support lang="en" on the input editor to control the decimal delimiter, but not Chrome. So we do not use it.

The font applied on the list is a UX decision. We have a specific column type for showing price and percentage related information that uses a monospace font. This is to ensure that all characters are the same width so it is easy to read a list of prices stacked on top of each other and each number is stacked exactly on top of each other. They are always right aligned and always have 2 decimals (with exceptions). Also the monospace highlights the delimiters so the numbers are faster to read and decipher.

You can see it here:

  • Normal font
    • 1.111,11
    • 2.333,33
    • 3.111,11
    • 5.655,66
  • Monospace font
    • 1.111,11
    • 2.333,33
    • 3.111,11
    • 5.655,66

The list of orders with monospace font:

And using the regular font

For listing price numbers in the list, e.g. the price list, we have discussed using the currency culture info to handle formatting - so if it is DKK using DA-DK, it would use danish formatting and if it is USD using EN-US, it would use american formatting. The problem is that you would have different number formats in the same list and that can be confusing.

Prices using currency formats:

  • EUR 1.234,56
  • USD 1,234.55

BR Nicolai

 
Lars Hejgaard Sørensen Dynamicweb Employee
Lars Hejgaard Sørensen
Reply

Hi Nicolai,

Thanks for your comprehensive answer. Makes good sense to display prices right aligned in monospace font :-)

Br.
Lars

 

You must be logged in to post in the forum