phone number display in transformation

lawrence whittemore asked on February 28, 2020 14:35

i'm trying to get a string to format like as a phone numner so something like this 3334445555 to show something like this (333) 444-5555 but am not having any luck. I've tried this String.Format("{0:(###) ###-####}", 8005551212); but doesn't seem to do anything to the number.

Correct Answer

lawrence whittemore answered on February 28, 2020 21:26

{% FormatString("{0: (###) ###-####}",Primary.ToInt()) #%} In the end this is what I got to work

Thanks!

0 votesVote for this answer Unmark Correct answer

Recent Answers


Zach Perry answered on February 28, 2020 18:52

Try removing the String.

{% Format("{0: (###) ###-####}",1231234567) #%}

0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on February 28, 2020 20:55

{% FormatString("{0: (###) ###-####}",1231234567) #%} This works... but how do I replace the number with my field?

0 votesVote for this answer Mark as a Correct answer

Zach Perry answered on February 28, 2020 21:06

if you are using xml transformation I think you can just put in the column name instead of the 121234567.

If it s the ascx transfromation, I think you will have to do Eval("columnName"). If that method requires 1231234567 to be a int you might have to do soemthing like Int64.Parse(Eval("Column").ToString())

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.