(Also, in Ultima 4 NES, money is not as easy to get as IMO it should be, especially when there's a mandatory purchase that costs 2,000 gold.)
It's called grinding
Also you want to talk money being tight in games? Try playing the original Ratchet and Clank and trying to gather the (iirc) 100 THOUSAND bolts for the best weapon. o.0
(It's 1 MILLION in the sequel, I believe....which is even harder to gather up)
I don't like the term "grinding", so I don't use it. I perfer to still use the old-fashioned term "leveling up" to refer to the task of accumulating experience points to get stronger, or to otherwise fighting to get stronger.
On the other hand, I don't mind the term "farming", for some reason.
Maybe it's because it feels like "grinding" has a negative connotation that "farming" does not?
In Final Fantasy 5, I just spent time farming ability points in Jachol Cave. (One tip: It might make sense to hold off on getting 2-handed (Knight skill that lets you wield a weapon with both hands); having a knight in this dungeon can keep you from having to constantly revive your characters against skull eaters.)
Also, in the game you mention, do you *really* need the best weapon, or can you reasonably beat the game without it? The purchase in Ultima 4 NES that I mention is a key that costs 2,000 gold (a lot when each encounter only gives an average of about 40), and it is not possible to beat the game without it; you can't skip it.
(By the way, for those curious, the key isn't the main factor that makes speedruns of Ultima 4 NES so long; it's actually the fact that there's more mandatory treasures that need to be found, 8 shrines to meditate at (in addition to having to find the rune for each one, and there's also 8 stones), and you have to win 49 normal encounters (dungeon rooms don't count) to reach avatarhood in Valor. Fortunately, you don't have to reach level 8 in the NES version; level 4 is enough to beat the game, and you don't need to recruit any allies either.)