Sorry for the weird title, but I don't really know how to explain this. Basically, I have this code that grabs from an API, however, if the numeric value is trying to display low. (Let's say 0.0008 or lower) it will display as a bunch of numbers and an e at the end.
Example: 8.888e-5 or something random.
How can I make it display as a number? Like: 0.00084BTC per PLSR.
(Python 3.6.4) It MUST Be kept as a String to work!
Why this is not a Duplicate: Although another thread found a similar answer to what I want, it doesn't exactly explain how to incorporate it into my code where I have already converted it into a string. Would I just overlay it overtop after its been converted to a string or..?
Code:
import requests
import discord
import asyncio
url = 'https://cryptohub.online/api/market/ticker/PLSR/'
response = requests.get(url)
data = response.json()['BTC_PLSR']
client = discord.Client()
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
price = print('PLSR Price:', data['last'])
pulsar = str(data['last'])
await client.change_presence(game=discord.Game(name="PLSR Price: " + pulsar))