Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

A Somewhat Extensive Guide to BBCodes

Forum Index > PokéFarm > Guides >

Pages: 123··· 756757758759760761762763

Kahuna's AvatarKahuna
Kahuna's Avatar

QUOTE originally posted by omg

im sorry if this has been asked before, but i was wondering if theres any way to round the results of the math bbcode, just to the nearest whole number? or is there a way to even just hide the numbers after a decimal altogether, and just show the whole number? its okay if not, its easy to just make do with what we've got now ofc ^^ was just curious if anyone had pointers in how i could play with that!!
I think there might be a better way to do it than this but I'm not sure what it is. The output of [math] is always rounded to the nearest hundredth, so we can exploit that with multiplication and division to round it to any higher decimal placement that we want. If I take the number 3.55 and want to round it, first I do:
[math]3.55/100[/math]
which results in: 0.04 Then to restore it back to its original state, we reverse the division by multiplying by 100. We have to do this in a separate math block, because it does not round until it calculates the full result of the math block. Our end expression is:
[math][math]3.55/100[/math]*100[/math]
which results in: 4 So to round any expression to the nearest whole number, we can use:
[math][math](any math expression)/100[/math]*100[/math]
If I forget to respond to a post or trade please PM me! I may have forgotten to subscribe. Avatar from Pokémon Showdown April Fools Day sprites, recolored by me.
omg's Avataromg
omg's Avatar
ohhh that's brilliant! thank you!! another question, and its totally okay if this one isn't doable, but is it possible to prevent it from ever rounding up, essentially ignoring the decimal? but still showing a whole number :o
Kat | | 21 ᨳ(⋆°͈꒳°͈)
click flag for it's credit!
visit my art shop! i hoard & prefer / ‹𝟥 icon ‹𝟥
louiserace's Avatarlouiserace
louiserace's Avatar

QUOTE originally posted by omg

im sorry if this has been asked before, but i was wondering if theres any way to round the results of the math bbcode, just to the nearest whole number? or is there a way to even just hide the numbers after a decimal altogether, and just show the whole number? its okay if not, its easy to just make do with what we've got now ofc ^^ was just curious if anyone had pointers in how i could play with that!!
The easiest way to do this is using [number][math]3.55[/math][/number]. This will give 3 (always round down) If you want to round to the nearest whole number then add 0.5 to the answer [number][math]3.55[b]+0.5[/b][/math][/number]. This will give 4
Please visit my shop
Avatar by Sharpy for my use only / Shop button by hamster
fontaine's Avatarfontaine
fontaine's Avatar
it seems to have slipped my mind -- can you grey out items when using the item= code? if so, how would i go about that?
ANGEL // FURINA SYSTEM // ADULT // SHE/THEY HIIII :P
Score: 2961
Mirzam's AvatarMirzam
Mirzam's Avatar
You can gray out almost any image with the grayscale filter:
[css="filter: grayscale(1);"][pkmn=Porygon2] [item=Up-Grade][/css] The CSS tag creates a new line - you can add "display: inline;" or "display: inline-block;" to make it share the line
Achillo's AvatarAchillo
Achillo's Avatar
Are FontAwesome icons usable on the site or no? I can't seem to get anything to work so I'm assuming not, but I figured I'd double check in case I was missing something!

Achi | She/they | 18+


Just a rat demon that enjoys Pokemon.
Shop JournalLinkcredits

credits

Code @RAINB0W Forum Icon by me. Signature Pagedoll @Name on Platform
Type Race Score; 1030
Mirzam's AvatarMirzam
Mirzam's Avatar
Now that's an interesting question... I'm going with v4 via CDN because things have gotten more complex in FontAwesome since then. But this was not exactly a beginner-friendly process, and is not one I'm confident I could explain well. (the biggest thing, is that I don't think I can @import cross-site CSS, and so I'm only including a portion of the full CSS file)
But there we go. So at minimum what you need is the entire font-face definition shown below, the entire .fa block, and then the specific icon block for each icon (in this case, just fa-paw). The icon-specific blocks can be found in the CDN's un-minimized CSS file. There's also like sizing and positioning blocks in there you could include, if you wanted - any time you added a "fa-" class to your icon [sc], you'd find its matching block in the CSS file and include that too. I suppppose you could dump that entire CSS file, plus the font URL mods I made here, into a skin file, and then import that skin file each time you want to use the icons. I don't really love that, idk if it's "proper", but I guess it would work? As long as @import keeps working that is.

Code

[sc="fa fa-paw"][/sc] [style] @font-face { font-family: 'FontAwesome'; src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.eot'); src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2') format('woff2'), url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff') format('woff'), url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.ttf') format('truetype'), url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.svg') format('svg'); font-weight: normal; font-style: normal; } .fa { display: inline-block; font: normal normal normal 14px/1 FontAwesome; font-size: inherit; text-rendering: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .fa-paw:before { content: "\f1b0"; } [/style]
Shadow vulpix's AvatarShadow vulpix
Shadow vulpix's Avatar
Is there another way to keep track of your chain how many eggs you've hatched how many shiny how many albino and melanistic I've been using the one below but I have to put an albino and melanistic in manually is there one that just does it automatically but still looks pleasing to the eye? 1020 [inventory=shinychain][img]https://pfq-static.com/img/pkmn/egg.png[/img][inventory=shinyshiny][img]https://pfq-static.com/img/pkmn/shiny.png[/img]0[img]https://pfq-static.com/img/pkmn/albino.png[/img]0[img]https://pfq-static.com/img/pkmn/melanistic.png[/img]

Click/read

Read my about me / I do hunts for summons and I can sell them to you at whatever you value them at all you have to do is PM me what summons you want and what you value them at. I also do hunts for boxboxes and you can send any unwanted S/A/D/M my way

Dragon cave eggs/Dragons

InHystericz's AvatarInHystericz
InHystericz's Avatar

QUOTE originally posted by Shadow vulpix

Is there another way to keep track of your chain how many eggs you've hatched how many shiny how many albino and melanistic I've been using the one below but I have to put an albino and melanistic in manually is there one that just does it automatically but still looks pleasing to the eye? 13501920 [inventory=shinychain][img]https://pfq-static.com/img/pkmn/egg.png[/img][inventory=shinyshiny][img]https://pfq-static.com/img/pkmn/shiny.png[/img]0[img]https://pfq-static.com/img/pkmn/albino.png[/img]0[img]https://pfq-static.com/img/pkmn/melanistic.png[/img]
Unfortunately there is no automatic code for albinos and melanistics ^^ just the chain and shinies
Chilly • They/Them • Australian Arceus WondersTrade Shop LF: Shattered Psyche
Score: 2885
Shadow vulpix's AvatarShadow vulpix
Shadow vulpix's Avatar
Ok thanks

Pages: 123··· 756757758759760761762763

Cannot post: Please log in to post

© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page