# NEED HELP % change in Earnings

#### bboyapollo

##### New member
Been at this for a week now and still can't seem to figure it out. All I want to do is get rid of the zeros on the plot.
The plot is a % change in Earnings from the previous one recorded. Here is what I have so far...
Code:
``````declare lower;
def EPS = if !isNaN(GetActualEarnings()) then GetActualEarnings() else EPS[1];
def a= EPS;
def b= EPS[1];

def calc =  (a-b)/b *100;

plot C;

if calc ==0 {
C =calc[1];
} else {
C = calc;
}``````

results as:

Solution
Here ya go:
Ruby:
``````declare lower;
def EPS = if !isNaN(GetActualEarnings()) then GetActualEarnings() else EPS[1];
def a= EPS;
def b= EPS[1];

def calc =  (a-b)/b *100;

plot C;

if calc ==0 {
C =calc[1];
} else {
C = calc;
}
C.hide();

plot NoZero_C = if C<=0 then double.NaN else C;
NoZero_C.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
NoZero_C.SetLineWeight(5);``````
Here ya go:
Ruby:
``````declare lower;
def EPS = if !isNaN(GetActualEarnings()) then GetActualEarnings() else EPS[1];
def a= EPS;
def b= EPS[1];

def calc =  (a-b)/b *100;

plot C;

if calc ==0 {
C =calc[1];
} else {
C = calc;
}
C.hide();

plot NoZero_C = if C<=0 then double.NaN else C;
NoZero_C.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
NoZero_C.SetLineWeight(5);``````

Here ya go:
Ruby:
``````declare lower;
def EPS = if !isNaN(GetActualEarnings()) then GetActualEarnings() else EPS[1];
def a= EPS;
def b= EPS[1];

def calc =  (a-b)/b *100;

plot C;

if calc ==0 {
C =calc[1];
} else {
C = calc;
}
C.hide();

plot NoZero_C = if C<=0 then double.NaN else C;
NoZero_C.SetPaintingStrategy(PaintingStrategy.LINE_VS_POINTS);
NoZero_C.SetLineWeight(5);``````
THANK YOU SO MUCH!!!

Anything I can help with? Feeling grateful .

Thanks again.

87k+ Posts
563 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?