how to format numbers with dollar sign in a cell for a CListCtrl
-
Hi guys what i want to do is to show some data in a ClistCtrl column like the following: ________________________________________ stuff |$ 434.55 | ---------------------------------------- stuff2|$ 22,333.55 | ---------------------------------------- stuff2|$ 86.55 | ---------------------------------------- have the dollar sign at the left side, and the number be always at the right side, can someone point me how to do this?? maybe calculing the size of the text and compare it to the cell rect and to some math there? but how how do you get the size of the text?, i remember seeing a function for that but i don't remember the name of it, or if you have an another suggestion please
-
Hi guys what i want to do is to show some data in a ClistCtrl column like the following: ________________________________________ stuff |$ 434.55 | ---------------------------------------- stuff2|$ 22,333.55 | ---------------------------------------- stuff2|$ 86.55 | ---------------------------------------- have the dollar sign at the left side, and the number be always at the right side, can someone point me how to do this?? maybe calculing the size of the text and compare it to the cell rect and to some math there? but how how do you get the size of the text?, i remember seeing a function for that but i don't remember the name of it, or if you have an another suggestion please
manchukuo wrote:
but how how do you get the size of the text?
GetTextExtentPoint32[^]. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
manchukuo wrote:
but how how do you get the size of the text?
GetTextExtentPoint32[^]. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Thanks CPallini that is the one i was looking for, so there is no easy way to achieve what i need? or i will have to do all the mungle jumble that i already wrote?
I would go with the mungle jumble (i.e. sorry, I don't know an alternative). :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Hi guys what i want to do is to show some data in a ClistCtrl column like the following: ________________________________________ stuff |$ 434.55 | ---------------------------------------- stuff2|$ 22,333.55 | ---------------------------------------- stuff2|$ 86.55 | ---------------------------------------- have the dollar sign at the left side, and the number be always at the right side, can someone point me how to do this?? maybe calculing the size of the text and compare it to the cell rect and to some math there? but how how do you get the size of the text?, i remember seeing a function for that but i don't remember the name of it, or if you have an another suggestion please
Have you tried
GetNumberFormat()
to properly insert the commas and decimal? Then just prefix a '$' and a number of spaces to the resulting string."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
Hi guys what i want to do is to show some data in a ClistCtrl column like the following: ________________________________________ stuff |$ 434.55 | ---------------------------------------- stuff2|$ 22,333.55 | ---------------------------------------- stuff2|$ 86.55 | ---------------------------------------- have the dollar sign at the left side, and the number be always at the right side, can someone point me how to do this?? maybe calculing the size of the text and compare it to the cell rect and to some math there? but how how do you get the size of the text?, i remember seeing a function for that but i don't remember the name of it, or if you have an another suggestion please