Number expected got nil

Hello, basically I am attempting to use the Abbreviation Number module. Module

My script is throwing me an error saying my number is nil, I’m not sure as to why it’s saying it’s nil when I print the number it’s giving me the number amount but the script is saying it’s nil.

As you can see it’s printing my number amount 100.

Cash.Tag.Label.Amount.Text = AbbreviateNumber.Abbreviate(amount)

Well can you show some code? Otherwise can’t help.

I’m so sorry, I just realised I forgot that.

Pretty much, it’s this which is throwing the error, I’m not sure why as It’s a number. (Amount)

Cash.Tag.Label.Amount.Text = AbbreviateNumber.Abbreviate(amount)

Is amount like “100” or 100, can you show that part?

Amount is the amount being dropped on the floor.

You should send the entire script, or at least a larger portion of it. From the snippet you sent, we cannot tell what data type AbreviateNumber.Abbreviate(amount) will yield.

I know but what does the variable look like

Is AbbreviateNumber a ModuleScript?

It’s just at the top of my function which I’m running when I tell the server to drop the certain amount of cash.
3XIKUSr

Yes, it is. I linked it in the topic I believe?

Are you sure the parameter “amount” is being sent over?
Can we see more code?

I’m positive, I printed it as you can see in the output image I posted.

100 is the amount I asked to be dropped

print(amount)

See what appears (or are you already doing that)

Already doing that, it prints the proper amount after I run the command.

The “amount” passed through is clearly nil. That’s what the error is describing. Can you show more code before the method call, including the print statement?

just before the line of code…
image

put
print(typeof(amount))

This will show what data type it is, to make sure its a number

I’m so sorry for the late reply, It shows it’s a number.
ITftYBP
I’m going to try using tonumber and see if that fixes my issue.

Nope, tonumber did not help the case at all. I’m so confused as to why it’s nil when it’s clearly a number and it’s getting the amount.

I’m so sorry for bothering everybody, i fixed the issue I was using . instead of : for calling the function within the module and that seemed to fix my problem after switching it.