I am trying to display repeating decimals in a TextView but using the HTML tag in Html.fromHtml is not working. Are there any other ways to display lines over numbers?
Asked
Active
Viewed 498 times
1 Answers
-1
Checkout this:
private static final StrikethroughSpan STRIKE_THROUGH_SPAN = new StrikethroughSpan();
...
tv.setText(s, TextView.BufferType.SPANNABLE);
Spannable spannable = (Spannable) tv.getText();
spannable.setSpan(STRIKE_THROUGH_SPAN, 0, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
Source: Is there an easy way to strike through text in an app widget?

Community
- 1
- 1

Victor Gomes
- 128
- 10
-
This is for striking through though, I need the line over the text. Or can I modify it somewhere? – Karl Konrad Mar 10 '17 at 13:25
-
can you show me an image of want you want it to look like? – Victor Gomes Mar 10 '17 at 13:49
-
Like those numbers in the table: https://en.wikipedia.org/wiki/Repeating_decimal#Table_of_values – Karl Konrad Mar 10 '17 at 17:28