This content has been marked as final. Show 6 replies
I would prefer to use a Datagrid with four columns. the first colum has the text inside with textalignment left, the second should have the numbers left of the decimal seperator with textalignment right, the third only should contain the decimal seperator and the last one the numbers right of the seperator with textalignment left
don't forget do adjust all the lines, border and backgroundcolors of the datagrid that it will look like a normal canvas
How would you split the number?
There are severel ways:
First: Cast the Number into a String and then use the function split (attention: if you want to split with the point you have to take care that the delimter parameter of the split function is a pattern so you have to escape the point, I think you can do this with the backslash, but to get sure read the docs about pattern)
Second: try to solve this problem with mathematic: To do this use the classes Math and/or Number
I think that it would be mutch easyer to just make 2 columns and the put the string in the first column left alligned and then the number in the second column right alligned.
Then I just have to assure that all the numbers have got the same number of decimals.
Sure that's also a solution, I don't know your requirements for your application, but if you do like you said before, you have to take care that every different number has the same width (I mean that the font which you are displaying your text is a non-proportional font)
I see. That solution will only work if the font is non-proportional.
I think that I will try you solution with the math.
Thanks for you help