function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aryan JhaAryan Jha 

Line: 1, Column: 45 Method does not exist or incorrect signature: void currencytoinr(Decimal) from the type CurrencyConvertorClass

public class CurrencyConvertorClass {
public static Decimal currencytoinr(Decimal eur)
{
    Http http=new Http();
    HttpRequest request=new HttpRequest();
    request.setEndpoint('http://api.exchangeratesapi.io/latest');
    request.setmethod('GET');
    HttpResponse res=http.send(request);
    if(res.getStatusCode()==200)
    {
        Map<String,Object>result=(Map<String,Object>)JSON.deserializeUntyped(res.getBody());
        system.debug(result);
        Map<Integer,Object>listrates=(Map<Integer,Object>)result.get('rates');
        Decimal conversionRate=(Decimal)listrates.get('INR');
        inr=eur*conversionrate;
        return inr;
    }
}
}

Decimal convertedAmt=CurrencyConvertorClass.currencytoinr(287.6);
system.debug(convertedAmt);
ShirishaShirisha (Salesforce Developers) 
Hi Aryan,

Greetings!

Can you please try the below to see,if it works:
Decimal convertedAmt= new CurrencyConvertorClass.currencytoinr(287.6);
system.debug(convertedAmt);

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri