Jump to content

Small Problem probably an easy answer.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Xlr8er

Xlr8er

    Newbie

  • Members
  • Pip
  • 4 posts
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 !

#2
bobdark

bobdark

    Programmer

  • Members
  • PipPipPipPip
  • 164 posts
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?

#3
Xlr8er

Xlr8er

    Newbie

  • Members
  • Pip
  • 4 posts
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 !

#4
bobdark

bobdark

    Programmer

  • Members
  • PipPipPipPip
  • 164 posts
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
Xlr8er

Xlr8er

    Newbie

  • Members
  • Pip
  • 4 posts
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

#6
curse

curse

    Newbie

  • Members
  • PipPip
  • 22 posts
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.

#7
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,717 posts
So where's the output? In the console, a file, on a GUI...?
sudo rm -rf /