triplemocha
triplemocha
CC#
Created by triplemocha on 12/8/2024 in #help
✅ "{0:C}" doesn't return the '$' symbol as it used to.
Thanks.
20 replies
CC#
Created by triplemocha on 12/8/2024 in #help
✅ "{0:C}" doesn't return the '$' symbol as it used to.
I did change the project's properties prior to programming in it. It's maybe a setting I changed accidently.
20 replies
CC#
Created by triplemocha on 12/8/2024 in #help
✅ "{0:C}" doesn't return the '$' symbol as it used to.
I'm guessing it's a .Net thing compared to the .Net framework.
20 replies
CC#
Created by triplemocha on 12/8/2024 in #help
✅ "{0:C}" doesn't return the '$' symbol as it used to.
I opened up the .csproj and changed InvariantGlobalization from true to false, and it worked fine.
20 replies
CC#
Created by triplemocha on 12/8/2024 in #help
✅ "{0:C}" doesn't return the '$' symbol as it used to.
I never had to use this in the past. I wonder if it's just required now to set the culture info. I got an exeception when trying that:
System.Globalization.CultureNotFoundException: 'Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
en-US is an invalid culture identifier.'
System.Globalization.CultureNotFoundException: 'Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
en-US is an invalid culture identifier.'
20 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
Ah, I see.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
unmanaged is new to me.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
Seems to be working. Thanks!
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
It's a custom Random class I made, so last value is max - 1.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
Same thing.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
I did.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
Appears to be working:
public static T NextValue<T>() where T : Enum
{
return (T)(object)Rand.Next(0, Enum.GetValues(typeof(T)).Length - 1);
}
public static T NextValue<T>() where T : Enum
{
return (T)(object)Rand.Next(0, Enum.GetValues(typeof(T)).Length - 1);
}
30 replies
CC#
Created by triplemocha on 7/7/2023 in #help
❔ Should procedural 2d maps be with structs or instantiated with 'new'?
Okay. To add, my intentions is to generate these in Unity and hope using classes won't cause a performance issue.
6 replies