Numeric values in tables have to be formatted by method .ToString("")
url=https://msdn.microsoft.com/cs-cz/library/kfsatb94(v=vs.110).aspxToString method description/url
Common incorrect formatting is done by VAL or ROUND functions -> it is not correct way
bIncorrect example from Check Response calculation:/b
code
TExtremes[4][0].Value = TR("Reinforcement - tension");
TExtremes[4][1].Value = Val(Fibre↓st,max,printâ†, 0);
TExtremes[4][2].Value = Val(ε↓st,maxâ†*1000, 2);
TExtremes[4][3].Value = Val(ε↓st,max,limâ†*1000, 2);
TExtremes[4][4].Value = Val(σ↓st,maxâ†/1000000, 2);
TExtremes[4][5].Value = Val(σ↓st,max,limâ†/1000000, 2);
TExtremes[4][6].Value = Val(Check↓value,stâ†, 2).ToString("0.00");
/code
This incorrect formatting due in fact nothing, and results are always drawn in default formatting -three valid number
bCorrect formatting:/b
code
TExtremes[4][0].Value = TR("Reinforcement - tension");
TExtremes[4][1].Value = Fibre↓st,max,printâ†.ToString("0");
TExtremes[4][2].Value = (ε↓st,maxâ†*1000).ToString("0.00");
TExtremes[4][3].Value = (ε↓st,max,limâ†*1000).ToString("0.00");
TExtremes[4][4].Value = (σ↓st,maxâ†/1000000).ToString("0");
TExtremes[4][5].Value = (σ↓st,max,limâ†/1000000).ToString("0");
TExtremes[4][6].Value = (Check↓value,stâ†).ToString("0.00");
/code
this is correct formatting - deflections (Epsilon) on 2 decimals, stresses (Sigma) on 0 decimal, check value on 2 decimals
Another examples of formatting are in attachment
Formatting numbers in table
Formatting numbers in table
- Attachments
-
- ToString.cls
- (29.61 KiB) Downloaded 457 times
Return to “Design forms features”
Who is online
Users browsing this forum: No registered users and 3 guests