Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Mathematica to create some images and labeling them after a simple calculation done previously. As the name of the file depends on the result, I want to show it with no decimal separator (because the "." can be a program as I'll use these images later on LabView). I'm using the following code:

ang = NumberForm[N[frac], {5, 2}]

where the result has 5 precise digits and 2 digits to the right of the decimal. Then, I'm doing angle = ang*100, but I still get the decimal marker but no number after it. How can I get rid of this?

share|improve this question
up vote 2 down vote accepted

Question: When you want to use this in the file name, why don't you use another character as NumberPoint?

ToString[NumberForm[N[8/3], {5, 2}, NumberPoint -> "_"]]

(* "2_67" *)

This can easily be included into a file name without problems.

To answer your question I have to start again with another question: Is there a special reason why you don't multiply by 100 and just round the result? (if you don't want it as String just remove the first function)


(* "267" *)
share|improve this answer
Thank you, that's what I was looking for. Using _ as a decimal separator is a great suggestion and the Round[] solution is what I wanted. – Eduardo Goncalves Feb 12 '13 at 16:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.