# Calculation Field where the results equals one '\$' character for every 100 dollars of value

## Recommended Posts

I have a calculation field, with a text result, that I want to give some sort of visual indication of how expensive an item is without displaying the actual price.

In a list view, I would want that text calculation field to provide quick visual reference as to how expensive an item is:

ITEM 1 - \$\$\$\$\$\$\$\$\$

ITEM 2 - \$\$\$

ITEM 3 - \$\$\$\$\$\$

ITEM 4 - \$\$\$\$\$\$\$\$\$\$\$

ITEM 5 - \$\$

Short of nested Ifs, what is an elegant way to achieve that calculation?

Thank you

##### Share on other sites
Posted (edited)

A simple way would be to put a cap on the number of characters and do just:

`Left ( "\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$" ; Round ( Price / 100 ; 0 ) )`

A more elegant way could be:

```Let ( [
n = Round ( Price / 100 ; 0 )
] ;
Substitute ( 10^n - 1 ; [ "9" ; "\$" ] ; [ "0" ; "" ] )
)```

This still imposes a maximum on the input Price, but the limit is 404 characters (i.e. \$40,400), so ...

--
P.S. Please update your profile to reflect your version and OS so we know what you can use.

Edited by comment

## Create an account

Register a new account