# Dollar Signs in Tick Marks

I want to display one axis using dollar amounts in the tickmarks (as "$500"). Searched the documentation but I cannot see AccountingForm doing that and I am stuck. • Ticks should see you right. This answer: mathematica.stackexchange.com/q/5276/131 should be adaptable. – Yves Klett Oct 21 '16 at 15:09 • Not that I can tell.Ticks -> {NumberForm[{0, 500, 1000}, NumberSigns -> {"-$", "$"}], Automatic} produces an error. – Nicholas G Oct 21 '16 at 15:14 • I used this as a workaround, but it seems embarassingly elaborate. I define a pair of values and same with the dollar sign prepended: tks = Table[{i, NumberForm[i, NumberSigns -> {"-$", "$"}]}, {i, 0, 1000, 500}] and then inside the graph Ticks -> {tks, Automatic}. – Nicholas G Oct 21 '16 at 15:19 • Adding a working, self-contained example may help getting more help. Your fix does not seem too bad though, if you are happy with the results. – Yves Klett Oct 21 '16 at 15:25 ## 1 Answer I figured it out, adapting it from here: Define a tick function using minimum and maximum: dollarticks[min_, max_] := {#, NumberForm[#, NumberSigns -> {"-$", "$"}]} & /@ N[FindDivisions[{min, max}, 3]]  Then use that in the graph with: Ticks -> {dollarticks, Automatic}  Quod erat demonstrandum. Then I developed a fuller version, that drops the trailing period signifying [working precision?]. First define a function that can also be used by itself in a tick specification: adollartick[x_] := {x, If[Round[x]==x,(*is the rightmost character a period, from some precision?*) NumberForm[Round@x, NumberSigns -> {"-$", "$"}, DigitBlock -> 3](*put dollar sign and comma and use Round to drop the last digit*) ,(*else*) NumberForm[x, NumberSigns -> {"-$", "\$"},
DigitBlock -> 3](*just put dollar sign and comma*)
]}


and then define the function for putting few dollar ticks:

dollarticks[min_, max_] := adollartick[#] & /@
N[FindDivisions[{min, max},
3]](*to produce dollar amounts as tick marks with few tickmarks*)


or many

dollarticks7[min_, max_] :=
N[FindDivisions[{min, max},
7]](*to produce dollar amounts as tick marks with more tickmarks*)


While we are at it, do the same for percentage ticks:

apercenttick[x_] := {x, If[
Round[100 x] == 100 x,(*is rightmost a period?*)
ToString[Round[100 x]],(*then drop it by using Round*)
ToString[100 x]](*else just multily by 100*)
<> "%"}(*and append a % sign*)

percentticks[min_, max_] := apercenttick[#]& /@ N[FindDivisions[{min, max}, 7]]