Hi there!
Still kinda new to this ... I am just wondering, if you get a return on something and it is in a percentage e.g 70% , how is it possible to get the return as 70 instead of having the % after it...
The Return is from a indicator I am useing but all is displayed in % which dosent seem to work if entered with a % sign....It is just the number that I want...
Thanks in advance !
Small Problem probably an easy answer.
Started by Xlr8er, Mar 01 2010 08:17 PM
6 replies to this topic
#1
Posted 01 March 2010 - 08:17 PM
|
|
|
#2
Posted 01 March 2010 - 11:14 PM
it depends on the return type. If the return type is a number describing type, i.e. int, float, double, long types, etc., you can return only a numerical value. If the return type is a string or array of characters, or something that includes on of those in it, you can convert he numerical value to a string of characters and concatenate the '%' in the end.
I hope it answers your question, though I'm not sure I understood it right.
What do you mean the return is from an indicator you're working with?
What kind of indicator? What does it do? What do you mean by "if entered with a % sign" - what kind of input does it get?
I hope it answers your question, though I'm not sure I understood it right.
What do you mean the return is from an indicator you're working with?
What kind of indicator? What does it do? What do you mean by "if entered with a % sign" - what kind of input does it get?
#3
Posted 02 March 2010 - 07:08 AM
Hey thanks for the help Yes I understand what you are saying
, the indicator is a 3rd party application don't worry too much about it its just a price indicator on the forex systems im working on ...
OK but say for example I use the "print (Indicator_Val);"
and It returns for example 70% ,
how do I get rid of the % sign...and Just have 70 as a return...
The coding of the indicator has already been compiled like
most indicators on the system so cant be edited...
I can manipulate the return value however I want
its just not the actualy value from
the indicators code that I can change...
So bottom line is to change an un-manipulable value of 70% to 70 or whatever value it indicates....
Hope you understand , thanks for your time !
, the indicator is a 3rd party application don't worry too much about it its just a price indicator on the forex systems im working on ...
OK but say for example I use the "print (Indicator_Val);"
and It returns for example 70% ,
how do I get rid of the % sign...and Just have 70 as a return...
The coding of the indicator has already been compiled like
most indicators on the system so cant be edited...
I can manipulate the return value however I want
its just not the actualy value from
the indicators code that I can change...
So bottom line is to change an un-manipulable value of 70% to 70 or whatever value it indicates....
Hope you understand , thanks for your time !
#4
Posted 02 March 2010 - 08:14 AM
well if its an already compiled application, you have to manipulate its output somehow. The how depends on the way it returns its output. For example if it prints it to standard output, you can probably make it spill the output into a file instead and then manipulate the file with your own personal application which you can write in whatever language you like, (adding/getting rid of the % sign in your case).
#5
Posted 02 March 2010 - 08:29 AM
Thanks man ... ! Yes true, only thing is it is like a live feeded indicator, so it is constantly changing... Sorry I don't know all the functions in c++ yet but if i get a returned value how would it be possible to remove that "%" sign automatically ...
Sorry I might have pathetic explaining skills haha
Sorry I might have pathetic explaining skills haha
#6
Posted 02 March 2010 - 12:50 PM
Assuming that the function that returns some value with a % sign is actually returning a character array, you simply need to write your own function which calls the former function and parses out the % character.
You haven't given us enough information/API to actually help you.
You haven't given us enough information/API to actually help you.
#7
Posted 02 March 2010 - 10:27 PM


Sign In
Create Account

Back to top









