I am creating a smart contract, so inside that I have to pass the token in contract and the value of ether will be calculate on behalf of token price please help.
You can only set the price of a token during its initial distribution phase (e.g. the crowdsale, ICO, etc.). Once the tokens have been initially sold, and they are out in the real world, then the price is set by supply and demand; you have no control.
If you are currently writing your token distribution contract (this is separate to the ERC-20 contract itself), then you can set the price there. Have a look at these (OpenZeppelin) example contracts.
However, your question is a bit ambiguous. If you've already distributed your tokens, then you won't be able to set the price. If you've published the ERC-20 contract but haven't distributed the tokens, then you should still be able to run your distribution phase using your distribution contract.